let ab_s = Array.init 3 @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a - 1, b - 1
let ds = Array.make 4 0
let _ = Array.(iter (fun (a, b) -> ds.(a) <- ds.(a) + 1; ds.(b) <- ds.(b) + 1) ab_s; print_endline @@ if List.for_all (fun d -> d <= 2) @@ to_list ds then "YES" else "NO")