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