Problem:
Score : 900 points

Problem Statement

Alice lives on a line. Today, she will travel to some place in a mysterious vehicle.
Initially, the distance between Alice and her destination is D. When she input a number x to the vehicle, it will travel in the direction of the destination by a distance of x if this move would shorten the distance between the vehicle and the destination, and it will stay at its position otherwise. Note that the vehicle may go past the destination when the distance between the vehicle and the destination is less than x.

Alice made a list of N numbers. The i-th number in this list is d_i. She will insert these numbers to the vehicle one by one.

However, a mischievous witch appeared. She is thinking of rewriting one number in the list so that Alice will not reach the destination after N moves.

She has Q plans to do this, as follows:

Rewrite only the q_i-th number in the list with some integer so that Alice will not reach the destination.

Write a program to determine whether each plan is feasible.

Constraints

1≤ N ≤ 5*10^5

1≤ Q ≤ 5*10^5

1≤ D ≤ 10^9

1≤ d_i ≤ 10^9(1≤i≤N)

1≤ q_i ≤ N(1≤i≤Q)

D and each d_i are integers.

Input

Input is given from Standard Input in the following format:

N D
d_1 d_2 ... d_N
Q
q_1 q_2 ... q_Q

Output

Print Q lines. The i-th line should contain YES if the i-th plan is feasible, and NO otherwise.

Sample Input 1

4 10
3 4 3 3
2
4 3

Sample Output 1

NO
YES

For the first plan, Alice will already arrive at the destination by the first three moves, and therefore the answer is NO.
For the second plan, rewriting the third number in the list with 5 will prevent Alice from reaching the destination as shown in the following figure, and thus the answer is YES.

Sample Input 2

5 9
4 4 2 3 2
5
1 4 2 3 5

Sample Output 2

YES
YES
YES
YES
YES

Alice will not reach the destination as it is, and therefore all the plans are feasible.

Sample Input 3

6 15
4 3 5 4 2 1
6
1 2 3 4 5 6

Sample Output 3

NO
NO
YES
NO
NO
YES

Solution in C++14 (GCC 5.4.1) (judge verdict: Time Limit Exceeded)

#include <bits/stdc++.h>
using namespace std;

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

using i64=int64_t;

void solve(){
    i64 N,D;
    cin >> N >> D;
    
    vector<i64> d(N);
    rep(i,0,N) cin >> d[i];

    vector<i64> pos(N+1);
    pos[0]=D;
    rep(i,1,N+1){
        i64 next=abs(pos[i-1]-d[i-1]);
        if(next<pos[i-1]) pos[i]=next;
        else pos[i]=pos[i-1];
    }

    i64 Q;
    cin >> Q;

    vector<vector<i64>> queries(500000);
    rep(i,0,Q){
        i64 q;
        cin >> q;
        queries[q-1].push_back(i);
    }

    vector<bool> ans(Q);
    set<pair<i64,i64>> curr;
    curr.insert(make_pair(0,0));


    for(int i=N-1; i>=0; --i){
        if(!queries[i].empty()){
            i64 p=pos[i];
            bool ok=p>curr.begin()->second;
            rep(j,0,queries[i].size()) ans[queries[i][j]]=ok;
        }

        set<pair<i64,i64>> next;
        auto add=[&](i64 l,i64 r){
            if(l>D) return;
            next.insert(make_pair(l,min(r,D)));
        };
        for(const pair<i64,i64>& in:curr){
            i64 l=in.first,r=in.second;
            add(d[i]+l,d[i]+r);

            if(2*l>d[i]) continue;
            i64 r_=min(r,d[i]/2);
            add(d[i]-r_,d[i]-l);
            add(l,r_);
        }

        curr.clear();

        i64 l=-1,r=-1;
        for(auto it=next.begin(); it!=next.end(); ++it){
            if(l==-1){
                l=it->first;
                r=it->second;
                continue;
            }
            if(r+1<it->first){
                curr.insert(make_pair(l,r));
                l=it->first;
                r=it->second;
                continue;
            }
            r=it->second;
        }
        curr.insert(make_pair(l,r));
    }

    rep(i,0,Q) if(ans[i]) cout << "YES" << endl;
    else cout << "NO" << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}