AtCoder Regular Contest 072
E
Alice in linear land
AtCoder
⌀ 2655
原题
←F →
翻译中…

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.

翻译中…

样例

Input #1
4 10
3 4 3 3
2
4 3
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`. ![image](https://atcoder.jp/img/arc072/f6a4307ef86847bc8fa68d0952f7127c.png)
Input #2
5 9
4 4 2 3 2
5
1 4 2 3 5
Output #2
YES
YES
YES
YES
YES
Alice will not reach the destination as it is, and therefore all the plans are feasible.
Input #3
6 15
4 3 5 4 2 1
6
1 2 3 4 5 6
Output #3
NO
NO
YES
NO
NO
YES
题目信息
题号
arc072_c
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。