from collections import Counter, defaultdict N = int(input()) def solve(): n,a,b = map(int, input().split()) if n == a * b and len(str(a)) == len(str(b)) and (a % 10 != 0 or b % 10 != 0): astr,bstr,nstr = map(str, [a,b,n]) c = defaultdict(lambda: 0) for char in astr+bstr: c[char] += 1 for char in nstr: c[char] -= 1 for x in c: if c[x] != 0: return False return True return False for _ in range(N): print("YES" if solve() else "NO")