#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int power(int a, int n){
  int result = a;
  for(int i = 1; i < n; i++){
    result *= a;
  }
  return result;
}

int main(){
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    vector<int> tri;
    for(int j = 0; j < n; j++){
      int tmp;
      cin >> tmp;
      tri.push_back(tmp);
    }
    sort(tri.begin(),tri.end());
    if(power(tri[0],2) + power(tri[1],2) == power(tri[2],2)){
      cout << "YES\n";
    }else{
      cout << "NO\n";
    }
  }
  return 0;
}