#include #include #include #include #include #include using namespace std; int n,m,x,i,k; int main() { //#ifndef ONLINE_JUDGE //freopen("a.in","r",stdin); //freopen("a.out","w",stdout); //#endif cin>>n>>m>>k; for(i=1;i<=k;i++) { cin>>x; if(n%x==0 && (m-2)%x==0) cout<<"YES\n"; else if((n-1)%x==0 && (m-1)%x==0) cout<<"YES\n"; else if((n-2)%x==0 && m%x==0) cout<<"YES\n"; else cout<<"NO\n"; } return 0; }