#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
queue<int>q;
int n;
int vis[50050];
int d[50050];
int s[2050];
void spfa()
{
memset(d,0x3f,sizeof(d));
q.push(0);
vis[0]=1;
d[0]=0;
while(!q.empty())
{
int t=q.front();
q.pop();
for(int i=1;i<n;i++)
{
if(d[(t+s[i])%s[0]]>d[t]+s[i])
{
d[(t+s[i])%s[0]]=d[t]+s[i];
if(!vis[(t+s[i])%s[0]])
{
vis[(t+s[i])%s[0]]=1;
q.push((t+s[i])%s[0]);
}
}
}
vis[t]=0;
}
}
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&s[i]);
spfa();
int q;
scanf("%d",&q);
while(q--)
{
int t;
scanf("%d",&t);
if(d[t%s[0]]<=t)
printf("YES\n");
else
printf("NO\n");
}
}