#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define inf 0x3f3f3f3f
const int N=2e5+5;
int n;
int check(int x){
if(x<2) return 0;
for(int i=2;i<=x/i;i++){
if(x%i==0) return 0;
}
return 1;
}
void solve(){
cin>>n;
while(n){
if(check(n)==0){
cout<<"NO"<<endl;
return;
}
n/=10;
}
cout<<"YES"<<endl;
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
cin>>t;
while(t--) solve();
return 0;
}
qsgg and Primes(素数)---牛客练习赛112-A
最新推荐文章于 2024-09-14 16:21:49 发布