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