#include #include using namespace std; bool is_fble(int x, int y, int a){ if((x % a == 0 && (y-2)%a == 0) || (y % a == 0 && (x-2)%a == 0) || ((x - 2) % a == 0 && (y - 1) % a == 0 && x%a == 0) || ((x - 1) % a == 0 && (y - 2) % a == 0 && y%a == 0) || ((x - 1) % a == 0 && (y - 1) % a == 0) ){ return true; } return false; } int main(){ int X,Y,N,num; cin >> X >> Y; cin >> N; for(int i = 0; i < N; ++i){ cin >> num; if(is_fble(X,Y,num)){ cout << "YES"; }else{ cout << "NO"; } cout << endl; } return 0; }