#Lutece3350. Sleepy Capoo

Sleepy Capoo

Description

Capoo the cat worm is studying at Cat Tech University. There are nn classes in a week, but Capoo often stays up all night playing video games, so he skips classes during the day to catch up on sleep. However, to avoid failing, Capoo plans to attend classes to earn participation points. Attending the ii-th class will increase Capoo's participation points by aia_i. When Capoo decides to attend classes, he will wake up before the xx-th class of this week and then spend a continuous period of time attending some classes over the next nn classes (possibly including classes from the next week, and not necessarily starting from the xx-th class).

Now, Capoo has mm plans. For each plan, he wakes up before the xx-th class and attempts to earn exactly kk participation points. However, Capoo isn't sure if his plan will succeed, so as his roommate, your task is to help him determine whether each plan is executable.

Input

The first line contains two integers n,mn, m (1n,m2×1051 \leq n, m \leq 2 \times 10^5), representing the number of classes in a week and the number of Capoo's plans, respectively.

The second line contains nn integers, representing aia_i (0ai20 \leq a_i \leq 2), the participation points Capoo can gain from each class.

The next mm lines each contain two integers x,kx, k (1xn,1k4×1051 \leq x \leq n, 1 \leq k \leq 4 \times 10^5), representing Capoo's plans.

Output

Output mm lines. For each plan, print YES if it is executable; otherwise, print NO.

Samples

6 4
1 2 2 1 1 0
1 8
3 5
4 5
3 3
NO
YES
YES
YES

Resources

电子科技大学第十五届 ACM 趣味程序设计竞赛