from math import* from collections import* def pf(n): a,f=defaultdict(int),2 while f*f<=n: if n%f:f+=1 else:a[f]+=1;n//=f if n>1:a[n]+=1 return a a,b=input().split() al,ar=map(int,a.split('.')) bl,br=map(int,b.split('.')) a=al*10000+ar ag=gcd(a,10000) a//=ag aq=10000//ag b=bl*10000+br bg=gcd(b,10000) b//=bg bq=10000//bg if b<0: b,bg=bg,-b if aq==bq==1: exit(print('Yes')) pa=pf(a) paq=pf(aq) for k,v in pa.items(): if v*b%bq: exit(print('No')) for k,v in paq.items(): if v*bq%b: exit(print('No')) if pa[k]*b