A,B=map(int,input().split()) i=1 b=[] mes='NO' while B*i<=A: b.append(B*i) i+=1 for i in range(1,int(A**0.5)+1): if A%i==0: if i in b or A//i in b: mes='YES' break print(mes)