def primeCheck(n): 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) prime.append(n) a, b = map(int, input().split()) prime = [] primeCheck(a) check = False for num in prime: if num % b == 0: check = True break if check: print('YES') else: print('NO')