A,B,C,D=map(int,input().split()) print(["NO","YES"][AD])