#include <iostream>
using namespace std;

int main(){
	int n;
	cin >>n;

	int a[n], b[n], c[n];

	for(int i=0; i<n; i++){
		if(a[i]*a[i] == b[i]*b[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(b[i]*b[i] == a[i]*a[i] + c[i]*c[i]){
			cout << "YES" << endl;
			continue;
		}
		if(c[i]*c[i] == b[i]*b[i] + a[i]*a[i]){
			cout << "YES" << endl;
			continue;
		}
		cout << "NO" << endl;
	}

	return 0;
}