#include using namespace std; bool solve(){ int a, b, c; cin>>a>>b>>c; if((long long) b * c != a) return false; if(a % 10 == 0 && b % 10 == 0) return false; string sa = to_string(a); string sb = to_string(b); string sc = to_string(c); int k = sb.size(); if(sc.size()!=k) return false; if(sa.size()!=k*2) return false; map cnts; for(auto i:sa) cnts[i]++; for(auto i:sb) cnts[i]--; for(auto i:sc) cnts[i]--; for(auto [k,c] : cnts) if(c!=0) return false; return true; } int main(){ int t; cin>>t; for(int i = 0; i < t; i++){ if(solve()){ cout << "YES\n"; } else{ cout << "NO\n"; } } }