

for i in range(int(input())):
	n,a,b = map(int,input().split(' '))
	if(a * b == n and a % 10 == 0 or b % 10 ==0):
		print("YES")
	else:
		print("NO")
		

