#!/usr/bin/python3

# Write a function that returns whether or not a divides b evenly
# This function is not ran until it is called
def factor(a, b):
    if(b % a == 0):
        return True
    else:
        return False

# The main portion of the program
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    if factor(a,b):
        print(a, 'is a factor of', b)
    else:
        print(a, 'is not factor of', b)