#include using namespace std; typedef long long ll; template ostream& operator<< (ostream& os, const vector & v) { os << "[ "; for (const T & elem : v) { os < elem << " "; } os << " ]"; return os; } ll count_digits(ll x) { ll result = 0; while (x) { result++; x /= 10; } return result; } bool check_vampire(ll n, ll a, ll b) { if (a * b != n) return false; if (count_digits(n) % 2 == 1) return false; ll k = count_digits(n) / 2; if (count_digits(a) != k || count_digits(b) != k) return false; if (a % 10 == 0 && b % 10 == 0) return false; multiset ab_digits; for (ll x = a; x; x /= 10) ab_digits.insert(x % 10); for (ll x = b; x; x /= 10) ab_digits.insert(x % 10); multiset n_digits; for (ll x = n; x; x /= 10) n_digits.insert(x % 10); if (ab_digits != n_digits) return false; return true; } void test_case() { ll n, a, b; cin >> n >> a >> b; if (check_vampire(n, a, b)) { cout << "YES" << endl; } else { cout << "NO" << endl; } } int main() { cin.tie(0); cout.tie(0); cin.exceptions(ios::failbit); ios::sync_with_stdio(false); ll t = 1; cin >> t; // potential comment while (t--) { test_case(); } return 0; }