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