#include <cstdio> #include <iostream> #include <fstream> #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <sstream> #include <iomanip> #include <cmath> #include <cstdlib> #include <ctype.h> #include <cstring> #include <string> #include <ctime> #include <cassert> #include <utility> using namespace std; int main() { // freopen("date.in", "r", stdin); // freopen("date.out","w", stdout); int x, y, n, a; scanf("%d %d\n%d", &x, &y, &n); for(int i = 0; i < n; i++) { scanf("%d\n", &a); if( (x % a == 0 && (y - 2) % a == 0) || ( (x - 1) % a == 0 && (y - 1) % a == 0) || ( (x - 2) % a == 0 && y % a == 0) || ( a == 2 && (x - 1) % a == 0 && (y - 2) % a == 0 && y % 2 == 0) || ( a == 2 && (y - 1) % a == 0 && (x - 2) % a == 0 && x % 2 == 0) ) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }