a, b = map(int, input().split()) f = 1 while f * f <= a: if a % f == 0: if a % b == 0 or (a // f) % b == 0: print("YES") exit() f += 1 print("NO")