def factorization(N):#素因数分解√N arr = [] temp = N for i in range(2, int(-(-N**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([N, 1]) return arr #[素因数、個数] import collections X,A,Y,B = map(int,input().split()) Xarr = factorization(X) Yarr = factorization(Y) Xcnt = collections.Counter() Ycnt = collections.Counter() for v,a in Xarr: Xcnt[v] = a*A for v,b in Yarr: Ycnt[v] = b*B flag = True for v,b in Ycnt.items(): if Xcnt[v] >= b: continue print('No') break else: print('Yes')