#include <stdio.h> int main() { int i,j; int t,a[10000]; int m; scanf ("%d",&t); for (i=0;i<t;i++) scanf ("%d",&a[i]); for (i=0;i<t;i++) { m=0; for (j=2;a[i]!=1;j++) while (a[i]%j==0) { a[i]/=j; m++; } if (m==2) printf ("Yes\n"); else printf ("No\n"); } return 0; }