from math import gcd a, b = map(int, input().split()) a, b = a // gcd(a, b), b // gcd(a, b) two = [1 << i for i in range(100)] five = [pow(5, i) for i in range(50)] if b in two or b in five: print("No") else: print("Yes")