fork download
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, t;
    cin >> t;
    while(t--) {
        cin >> n;
        int cnt=0;
        for(int i=1; i<=sqrt(n); i++) {
            if(n%i==0) {
                cnt++;
            }
        }
        if(cnt<=1) {
            cout << "yes" << endl;
        } else cout << "no" << endl;
    }
}
Success #stdin #stdout 0s 5300KB
stdin
5
23
13
20
1000
99991
stdout
yes
yes
no
no
yes