#include using namespace std; int rest, x, y, n, a; bool ok; int main() { cin >> x >> y; cin >> n; for(int i=1; i<=n; i++){ ok=false; cin >> a; rest=x-a; if(rest%a == 0 && (y-2)%a == 0){ cout << "YES"; ok=true; } if(!ok && rest%a == 1 && (y-1)%a == 1){ cout << "YES"; ok=true; } rest=x-a-1; if(!ok && rest%a == 0 && (y-1)%a == 1){ cout << "YES"; } if(!ok && rest%a == 1 && y%a == 0){ cout << "YES"; ok=true; } if(!ok) cout << "NO"; } return 0; }