#include<iostream>
using namespace std;
int main() {
	int x[3][1000];
	int a,b,c;
	cin >> b;
	for(a=0;a<b;a++) {
		for(c=0;c<3;c++) {
			cin >> x[c][a];
		}
	}
	for(a=0;a<b;a++){
		if(x[1][a]/3 == x[2][a]/4 && x[2][a]/4 == x[3][a]/5 || x[2][a]/5 == x[3][a]/4 || x[1][a]/4 == x[2][a]/3 && x[2][a]/3 == x[3][a]/5 || x[2][a]/5 == x[3][a]/3 || x[1][a]/5 == x[2][a]/3 && x[2][a]/3 == x[3][a]/4 || x[2][a]/4 == x[3][a]/3){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}