A,B=sorted(map(int,input().split())) import math for i in range(A, B+1): if A%i == 0 and i%B == 0: print('YES') exit() if i%A == 0 and B%i == 0: print('YES') exit() print('NO')