- 试除法判定质数
#include<iostream>
#include<cmath>
using namespace std;
bool cmp(int x)
{if (x==1) return false;for (int i=2;i<=sqrt(x);i++){if (x%i==0) return false;}return true;
}
int main()
{int n,num;cin>>n;while (n--){cin>>num;bool f = cmp(num);if (f == false) cout<<"No"<<endl;else cout<<"Yes"<<endl;}return 0;
}