x,a,y,b=map(int,input().split()) c=pow(x,a) d=pow(y,b) if c%d==0: print("Yes") else: print("No")