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

bool is_prime(int x)
{
    if(x < 2) return false;
    for(int i = 2; i <= x / i; i++)
    // for(int i = 2; i <= sqrt(x); i++)
    {
        if(x % i == 0) return false;
    }
    return true;
}

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        if(is_prime(n)) cout << "Yes" << endl;
        else cout << "No" << endl;
        
    }
    return 0;
}