import math def O(b):exit(print("YNeos"[b::2])) A,B=input().split() if B=="0.0000":O(0) c=10000 if B[0]=='-': a=int(A[:-5]+A[-4:]) if c%a:O(1) a=c//a elif"0"*4!=A[-4:]:O(1) a=int(A.split('.')[0]) if a<2:O(0) g=0 for d in range(2,a+1): e=0 while a%d<1:a//=d;e+=1 g=math.gcd(g,e) O(int(B.split('.')[1])*g%c>0)