let () =
  let d = Array.make 4 0 in
  for i = 0 to 2 do
    Scanf.scanf "%d %d\n" @@ fun a b ->
      d.(a - 1) <- 1 + d.(a - 1);
      d.(b - 1) <- 1 + d.(b - 1)
  done;
  print_endline @@ if
    List.length (List.filter (fun d -> d mod 2 = 1) (Array.to_list d)) = 2
  then "YES"
  else "NO"
