#include using namespace std; int main() { int X,Y,N,T; cin>>X>>Y; cin>>N; while(N--) { int ok=0; cin>>T; if (Y%T==0 && (X-2)% T ==0) ok=1; else if (X%T==0 && (Y-2)%T==0) ok=1; else if ((X-1)%T==0 && (Y-1)%T==0) ok=1; else if ((X-2)%T==0 && (Y-1)%T==0 && X%T==0) ok=1; else if ((Y-2)%T==0 && (X-1)%T==0 && Y%T==0) ok=1; else cout<<"NO\n"; if (ok==1) cout<<"YES"; } return 0; }