def primeCheck(n): prime = [] s = [0, 0, 2] for i in range(3, n + 1, 2): s.append(i) s.append(0) for i in range(3, n + 1, 2): if s[i] != 0: j = 3 while i * j <= n: s[i * j] = 0 j += 2 for m in s: if m > 0: prime.append(m) for m in prime: if n % m == 0: primeFactor.append(m) primeFactor.append(n) a, b = map(int, input().split()) if a != b: primeFactor = [] primeCheck(a) check = False for num in primeFactor: if num % b == 0: check = True break else: check = True if check: print('YES') else: print('NO')