import math A, B = map(int, input().split()) R = math.gcd(A, B) A //= R B //= R while B % 2 == 0: B //= 2 while B % 5 == 0: B //= 5 if B == 1: print("No") else: print("Yes")