#include using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair; using vi = vector; using vll = vector; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll t, n, a, b; cin >> t; while (t--) { bool vamp = true; cin >> n >> a >> b; if (n != a * b) vamp = false; if (to_string(a).size() != to_string(b).size()) vamp = false; if (a % 10 == 0 && b % 10 == 0) vamp = false; string comb = to_string(a) + to_string(b); string n_str = to_string(n); std::map count; for (const auto x: comb) { if (count.contains(x)) count[x] ++; else count[x] = 1; } for (const auto x: n_str) { if (count.contains(x)) count[x] --; else count[x] = -1; } for (auto & [key, val]: count) { if (val != 0) { vamp = false; break; } } if (vamp) cout << "YES" << endl; else cout << "NO" << endl; } }