A=[int(x) for x in input().split()] if A[0]A[3]: print("YES") else: print("NO")