a,b = map(int,input().split()) while b%2 == 0: b = int(b/2) while b%5 == 0: b = int(b/5) if b == 1 or a % b ==0: print("No") else: print("Yes")