A,B=map(int,input().split()) flag=0 for i in range(1,A//2+1): if A%i==0 and (i%B==0 or (A//i)%B==0): flag=1 print("YES" if flag==1 or A+B==2 else "NO")