let () =
    let input = Array.init 3 (fun _ -> Scanf.scanf "%d %d\n" (fun a b -> (a, b))) in
    let junc = Array.init 5 (fun _ -> 0) in
    Array.iter (fun (j1, j2) -> junc.(j1) <- junc.(j1) + 1; junc.(j2) <- junc.(j2) + 1) input;
    print_endline @@ if Array.fold_left (fun acc j -> acc || j > 2) false junc
        then "NO"
        else "YES"