def make_divisors(N):#約数列挙O(√N) lower_divisors , upper_divisors = [], [] i = 1 while i*i <= N: if N % i == 0: lower_divisors.append(i) if i != N // i: upper_divisors.append(N//i) i += 1 return lower_divisors + upper_divisors[::-1] A,B = map(int, input().split()) AP = set(make_divisors(A)) print('YES' if B in AP else 'NO')