a,b=map(int,input().split()) for i in range(1,int(a**.5)+1): if a%i==0: if i%b==0 or (a//i)%b==0: print('YES') exit() print('NO')