A, B = map(int, input().split()) for i in range(1, 101): if A % i == 0 and i % B == 0: print("YES") exit() print(i) print("NO")