#include<cstdio>
#include<vector>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<map>
#include<set>
#include<queue>
#include<algorithm>

using namespace std;

int N, M, x, Q;

bool ok (int x, int N, int M)
{
    if (x == 1) return 1;
    if (M % x > 1) return 0;
    if (M % x == 0) return ((N - 2) % x == 0);
    return ((N - 1) % x == 0);
}

int main()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d%d", &N, &M);
scanf ("%d", &Q);
while (Q)
{
    Q --;
    scanf ("%d", &x);
    if (ok (x, N, M) || ok (x, M, N)) printf ("YES\n");
    else printf ("NO\n");
}
return 0;
}