from collections import Counter def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a X,A,Y,B = map(int,input().split()) c = Counter(prime_factorize(X)) for (k,v) in Counter(prime_factorize(Y)).items(): if k not in c.keys():exit(print('No')) elif c[k]*A