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