Problem: Paul was the most famous character in Tekken-3. Of course he went to college and stuff. In one of the exams he wasn't able to answer a question which asked to check if a tuple of 3 non negative integers constituted a Primitive Pythagorian Triplet or not.  Paul was not able to answer it correctly and henceforth, he could not concentrate on any fight for a very long time and lost most of them. So, he decided to learn everything about Primitive Pythagorian Triplets.

Now, Paul seeks your help to determine whether a given triplet is a Primitive Pythagorian Triplet or not.

INPUT :  

The first line of the input contains the number of test cases T.
Every test case has a single line containing 3 space separated integers a,b and c.

OUTPUT :   

The output to each test case is a "YES" or a "NO".

CONSTRAINTS :   

1 ≤ T ≤ 100000

0 ≤ a,b,c ≤ 10000000

NOTE:
A primitive Pythagorean triple is one in which a, b and c are coprime.

SAMPLE INPUT
4
3 4 5
10 8 6
9 2 5
12 5 13

SAMPLE OUTPUT
YES
NO
NO
YES

Solution (in PYTHON):

Solution:
from fractions import gcd
t=int(raw_input())
store=[]
for i in range(t):
	temp=raw_input()
	temp.rstrip('\n')
	store.append(temp)
for i in range(t):
	val=store[i].split()
	a=int(val[0])
	b=int(val[1])
	c=int(val[2])
	sum1=int(pow(a,2))+int(pow(b,2))
	sum2=int(pow(b,2))+int(pow(c,2))
	sum3=int(pow(a,2))+int(pow(c,2))
	if(gcd(a,b)==1 and gcd(a,c)==1 and gcd(b,c)==1 and int(sum1)==int(pow(c,2))):
		print "YES"
	elif( gcd(a,b)==1 and gcd(a,c)==1 and gcd(b,c)==1 and int(sum2)==int(pow(a,2))):
		print "YES"
	elif(gcd(a,b)==1 and gcd(a,c)==1 and gcd(b,c)==1 and int(sum3)==int(pow(b,2))):
		print "YES"
	else:
		print "NO"