let split str =
  let rec split_inner ct b=
    if String.length str = ct then [int_of_string b]
    else
      match str.[ct] with
        ' ' -> (int_of_string b)::split_inner (ct+1) ""
      | c -> split_inner (ct+1) (b^(Char.escaped c))
  in split_inner 0 "";;

let () =
  let is_right l =
    match l with
      [a;b;c] -> if a*a + b*b = c*c then "YES" else "NO"
    | _ -> "NO" and
      n = read_int () in
  let rec read i =
    let line = read_line () |> split in
    is_right line |> print_endline;if i > 0 then read (i-1)
  in read (n-1);;