#include <iostream>
#define nmax 1005

using namespace std;

int x, y, n, a[nmax], 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[i];
    }
    for(int i=1; i<=n; i++){
        if((p-dif)%a[i] == 0)
           cout << "YES\n";
        else
            cout << "NO\n";
    }
    return 0;
}