let ab_s = Array.init 3 @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b -> a, b
let cs = Array.make 5 0
let _ = Array.iter (fun (a, b) -> cs.(a) <- cs.(a) + 1; cs.(b) <- cs.(b) + 1) ab_s;
  for i = 1 to 4 do if cs.(i) = 0 || cs.(i) >= 3 then (print_endline "NO"; exit 0) done;
  print_endline "YES"