#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); vector B={3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79, 83,89,97}; int a=B.size(); vector> C(a); rep(i,a){ int j=0; while(C[i].size()<(B[i]+1)/2){ C[i].insert(j*j%B[i]); j++; } } int t; cin>>t; while(t--){ int n; cin>>n; vector A(n); rep(i,n) cin>>A[i]; bool b=true; rep(i,a){ ll tmp=1; rep(j,n) tmp=tmp*(A[j]%B[i])%B[i]; if(C[i].count(tmp)==0) b=false; } if(b) cout<<"Yes"<