#include using namespace std; using ll = long long; using vi = vector; using pi = pair; void solve () { ll n, a, b; cin >> n >> a >> b; string sa = to_string(a), sb = to_string(b), sn = to_string(n); sa += sb; sort(sa.begin(), sa.end()); sort(sn.begin(), sn.end()); bool good = n == a * b && sb.size() * 2 == sn.size() && (a % 10 != 0 || b % 10 != 0) && sa == sn; cout << (good ? "YES\n" : "NO\n"); } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while (t--) solve(); return 0; }