import math def SoE(x): nums = [i for i in range(x+1)] root = int(pow(x,0.5)) for i in range(2,root + 1): if nums[i] != 0: for j in range(i, x+1): if i*j >= x+1: break nums[i*j] = 0 primes = sorted(list(set(nums)))[2:] return primes def factorization(x, p): ret = [] while x != 1: for a in p: cnt = 0 while x%a == 0: cnt += 1 x = x//a if cnt != 0: ret.append((a, cnt)) if x != 1: ret.append((x, 1)) return ret def prime_factorization(n): #assert 1 <= n dic = dict() for p in range(2, n+1): if p * p > n: break if n % p == 0: cnt = 0 while n % p == 0: cnt += 1 n //= p dic[p] = cnt if n > 1: dic[n] = 1 return dic A, B = input().split() a0 = A.split(".")[0] a1 = A.split(".")[1] b0 = B.split(".")[0] b1 = B.split(".")[1] b1 = int(b1) B_ = float(B) if (B_ == 0): print("Yes") exit() if (int(a1) != 0 and B_ != 0): print("No") exit() Prime = SoE(1000000) di = prime_factorization(int(a0)) for (k, v) in di.items(): if (v * b1) % 10000 != 0: print("No") exit() print("Yes")