let read () = Scanf.scanf "%d.%d.%d " (fun a b c -> a, b, c) let base = 101 let () = let a, b, c = read () in let n = 2*base*a + base*b + c in let a, b, c = read () in let m = 2*base*a + base*b + c in print_endline (if m < n then "YES" else "NO")