import sys import math a,b = map(int,input().split()) if a%b == 0: print('No') sys.exit() rm = a%b gc = math.gcd(rm,b) b1 = b//gc while b1%2 == 0: b1//=2 while b1%5 == 0: b1//=5 if b1 == 1: print('No') sys.exit() print('Yes')