def b(x):return x if x%2 else b(x/2) def f(x):return x if x%5 else f(x/5) n,m=map(lambda x: b(f(int(x))),input().split()) print("Yes" if n%m and m>1 else "No")