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