#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1000005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int x,n,m,v[10];

inline bool Ok()
{
    v[1]=v[3]=n; v[2]=v[4]=m;
    if(v[1]%x>2) return false;
    if(v[1]%x==0)
    {
        --v[2]; --v[4];
    }
    else
        if(v[1]%x==1) --v[4];
    if(v[2]%x>1) return false;
    if(v[2]%x==0) --v[3];
    if(v[3]%x>1) return false;
    if(v[3]%x==0) --v[4];
    if(v[4]%x==0) return true;
    return false;
}

int main()
{
    int T;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin>>n>>m;
    cin>>T;
    while(T--)
    {
        cin>>x;
        if(Ok()) cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}