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