#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define mp make_pair #define pb push_back #define ff first #define ss second typedef pair pii; typedef long long ll; int main(){ int x,y; cin >> x >> y; int n; cin >> n; while(n--){ int a; cin >> a; if(x%a == 0 && (y-2) % a==0){ cout << "YES\n"; } else if(y%a == 0 && (x-2) % a == 0) cout << "YES\n"; else if(x%a == 0 && (y-1) % a == 0 && (x-2) % a == 0) cout << "YES\n"; else if(y%a == 0 && (x-1) % a == 0 && (y-2) % a == 0) cout << "YES\n"; else if((x-1)%a == 0 && (y-1)%a == 0) cout << "YES\n"; else cout << "NO\n"; } }