import sys input = sys.stdin.readline a,b=map(int,input().split()) from math import gcd b//=gcd(a,b) while b!=1: if b%2==0: b//=2 elif b%5==0: b//=5 else: break if b==1: print("No") else: print("Yes")