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