let a = Array.init 6 (fun _ -> Scanf.scanf " %d" pred)
let b = Array.init 4 @@ fun i ->
  Array.fold_left (fun v e -> if e = i then v+1 else v) 0 a
let () =
  Array.sort (-) b;
  print_endline (if b = [|1; 1; 2; 2|] then "YES" else "NO")