#include using namespace std; int x,y,q,piece; bool solve (int p) { if (p>x || p>y) return 0; if (x%p==0 && (y-2)%p==0) return 1; if (y%p==0 && (x-2)%p==0) return 1; if ((x%p==1) && (y%p)==1) return 1; return 0; } int main() { cin>>x>>y; cin>>q; while (q--) { cin>>piece; if (solve(piece)) cout<<"YES"<<'\n'; else cout<<"NO"<<'\n'; } return 0; }