#include using namespace std; typedef long long ll; ll gcd(ll x,ll y){ if(x> t; while(t){ t--; ll n,a,b; cin >> n >> a >> b; if(gcd(a,b)!=1) cout << "NO" << endl; else cout << "YES" << endl; } }