Problem: We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer t Т-prime, if t has exactly three distinct positive divisors.

You are given an array of n positive integers. For each of them determine whether it is Т-prime or not.

Input

The first line contains a single positive integer, n (1 ≤ n ≤ 105), showing how many numbers are in the array. The next line contains n space-separated integers xi (1 ≤ xi ≤ 1012).

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is advised to use the cin, cout streams or the %I64d specifier.

Output

Print n lines: the i-th line should contain "YES" (without the quotes), if number xi is Т-prime, and "NO" (without the quotes), if it isn't.

Examples

Input

3
4 5 6


Output

YES
NO
NO

Note

The given test has three numbers. The first number 4 has exactly three divisors — 1, 2 and 4, thus the answer for this number is "YES". The second number 5 has two divisors (1 and 5), and the third number 6 has four divisors (1, 2, 3, 6), hence the answer for them is "NO".

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
bool CMP(int a, int b) { return a > b; }
long long int p = 1e9 + 7;
long long int power2(long long int n) {
  long long int res = 1;
  for (long long int i = 1; i <= n; i++) res *= 2;
  return res;
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int cnt1 = 0, u, cnt = 0;
vector<vector<long long int>> adj1(200010);
vector<vector<long long int>> adj(200010);
vector<long long int> wt(200010);
long long int a[310068], vis[300100], last1[10000];
vector<long long int> viso;
bool ok = false;
long long int m, ans = 0;
void dfs(long long int k, long long int parent) {
  if (vis[k] != 1) {
    vis[k] = 1;
    if (a[k] == 1) {
      a[k] = parent + 1;
    }
    if (a[k] <= m) {
      if (adj[k].size() == 1 && k != 1)
        ans++;
      else {
        for (long long int i = 0; i < adj[k].size(); i++) dfs(adj[k][i], a[k]);
      }
    }
  }
}
long long int dp[200010];
bool mycompare(string s, string t) {
  string x = s + t;
  string y = t + s;
  if (x > y)
    return 1;
  else
    return 0;
}
long long int maxi = 1e7;
set<long long int> w;
pair<long long int, long long int> rotate(long long int x, long long int y,
                                          long long int a, long long int b,
                                          long long int t) {
  long long int i;
  for (i = 0; i < t; i++) {
    long long int p = a + b - y, q = x + b - a;
    x = p, y = q;
  }
  pair<long long int, long long int> P = make_pair(x, y);
  return P;
}
long long int dist(long long int x1, long long int y1, long long int x2,
                   long long int y2) {
  long long int d = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
  return d;
}
bool check(long long int x1, long long int y1, long long int x2,
           long long int y2, long long int x3, long long int y3,
           long long int x4, long long int y4) {
  long long int d2 = dist(x1, y1, x2, y2);
  long long int d3 = dist(x1, y1, x3, y3);
  long long int d4 = dist(x1, y1, x4, y4);
  if (d2 == 0 || d3 == 0 || d4 == 0) return false;
  if (d2 == d3 && d4 == 2 * d2 &&
      2 * dist(x2, y2, x4, y4) == dist(x2, y2, x3, y3))
    return true;
  if (d3 == d4 && d2 == 2 * d3 &&
      2 * dist(x2, y2, x3, y3) == dist(x3, y3, x4, y4))
    return true;
  if (d2 == d4 && d3 == 2 * d2 &&
      2 * dist(x2, y2, x3, y3) == dist(x2, y2, x4, y4))
    return true;
  return false;
}
int siam(int m) {
  for (int i = 2; i * i <= m; i++) {
    if (m % i == 0) return 1;
  }
  return 0;
}
int main() {
  long long int n;
  cin >> n;
  long long int i;
  for (long long i = (0); i < (n); i++) {
    long long int q;
    cin >> q;
    double m = ceil(sqrt(q));
    double k = floor(sqrt(q));
    if (m - k == 1 || q == 1)
      cout << "NO" << endl;
    else {
      int result = siam(k);
      if (result == 0)
        cout << "YES" << endl;
      else if (result == 1)
        cout << "NO" << endl;
    }
  }
}