#include#include using namespace std;const int MAXN=10000001;inline int read(){ char c=getchar();int f=1,x=0; while(c<'0'||c>'9') {if(c=='-') f=-1;c=getchar();} while(c>='0'&&c<='9') x=x*10+c-48,c=getchar();return x*f;}int vis[MAXN],prime[MAXN];int tot=0;int n,m;int Euler(){ vis[1]=1; for(int i=2;i<=n;i++) { if(vis[i]==0) prime[++tot]=i; for(int j=1;j<=tot&&i*prime[j]<=n;j++) { vis[i*prime[j]]=1; if(i%prime[j]==0) break; } }}int main(){ n=read();m=read(); Euler(); for(int i=1;i<=m;i++) { int p=read(); if(vis[p]==1) printf("No\n"); else printf("Yes\n"); } return 0;}