#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<queue>
#include<vector>
using namespace std;
int dp[500005];
bool ok[500005];
int mon[205],mc[205],w[500005];
int main()
{
int n,m;cin>>n>>m;
for (int i=1;i<=n;++i) cin>>mon[i]>>mc[i];
int maxx=-1;
for (int i=1;i<=m;++i)
{
cin>>w[i];
maxx=max(maxx,w[i]);
}
memset(ok,0,sizeof(ok));
ok[0]=1;
for (int i=1;i<=m;++i)
{
memset(dp,0,sizeof(dp));
for (int j=mon[i];j<=maxx;++j)
{
if(!ok[j]&&ok[j-mon[i]]==1&&dp[j-mon[i]]<mc[i])
{
ok[j]=1;
dp[j]=dp[j-mon[i]]+1;
}
}
}
for (int i=1;i<=m;++i)
if (ok[w[i]])
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
return 0;
}