#include #include #include #include using namespace std; int main() { int t; cin >> t; while (t--) { long long n, a, b; cin >> n >> a >> b; bool is_v = false; if (n == a *b) { string ns = to_string(n); string as = to_string(a); string bs = to_string(b); map m; bool is_amt = 0; for (int i = 0; i < ns.size(); ++i) { m[ns[i]]++; } if (as.size() == bs.size()) { map abm; for (int i = 0; i < as.size(); ++i) { abm[as[i]]++; abm[bs[i]]++; } bool premutable = true; for (auto &p : m) { if (abm[p.first] != p.second) { premutable = false; } } if (premutable) { if (a % 10 !=0 || b % 10 != 0) { is_v = true; } } } } if (is_v) { cout << "YES\n"; } else { cout << "NO\n"; } } return 0; }