a1,a2,a3,a4=map(int,input().split()) if a1a4: print('YES') else: print('NO')