import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 a,b=MI() from math import gcd g=gcd(a,b) a=a//g b=b//g while b%2==0: b=b//2 while b%5==0: b=b//5 if b==1: print("No") else: print("Yes") main()