#include<bits/stdc++.h>
using namespace std;
int v[10001],a[201],b[201];
int i,j,k,x,n,m,ans,maxx;
int main(){
//freopen("watch.in","r",stdin);
//freopen("watch.out","w",stdout);
cin>>n>>m;
for(i=1;i<=n;++i){
cin>>a[i]>>b[i];
}
for(i=1;i<=m;++i){
cin>>v[i];
if(v[i]>maxx)maxx=v[i];
}
int s[maxx+1];
for(i=1;i<=m;++i){
memset(s,0,sizeof(s));s[0]=1;
for(k=1;k<=n;++k){
for(x=1;x<=b[k];++x){
s[a[k]*x]=1;
}
}
if(s[v[i]]==1){
cout<<"Yes"<<endl;
continue;
}
else{
for(j=v[i];j>=1;--j){
if(s[j]==0){
for(k=1;k<=n;++k){
if(j%a[k]!=0){
for(x=1;x<=b[k];++x){
if(j>=a[k]*x)
if(s[j-a[k]*x]==1)s[j]=1;
}
}
}
}
}
if(s[v[i]]==1)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
return 0;
}