def create_divisors(n): divisors=[] for i in range(1,int(n**0.5)+1): if n%i==0: divisors.append(i) if i!=n//i: divisors.append(n//i) divisors.sort() return divisors a,b=map(int,input().split()) d=create_divisors(a) for dd in d: if dd%b==0: print("YES") exit(0) print("NO")