#include using namespace std; long n,i,j,x,y,d; int main() { cin>>x>>y>>n; for (i=1;i<=n;i++) { cin>>d; if (x%d==0 && y%d==2) cout<<"YES\n"; else if (x%d==1 && y%d==1) cout<<"YES\n"; else if (x%d==2 && y%d==0) cout<<"YES\n"; /* else if (x%d==0 && y%d==1 && (x-1)%d==0) cout<<"YES\n"; else if (y%d==0 && x%d==1 && (y-1)%d==0) cout<<"YES\n";*/ else if (d==2) cout<<"YES\n"; else cout<<"NO\n"; } return 0; }