import math x,a,y,b=map(int,input().split()) if math.gcd(x,y)==1: print("No") else: print("Yes")