a,b=map(int,input().split()) def make_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) return divisors tmp=make_divisors(a) for i in range(len(tmp)): if tmp[i]%b==0: print("YES") exit() print("NO")