← Home
write a go solution for Description:
Monocarp is playing a computer game. He starts the game being level 1. He is about to fight n monsters, in order from 1 to n. The level of the i-th monster is a_i.

For each monster in the given order, Monocarp's encounter goes as follows:

- if Monocarp's level is strictly higher than the monster's level, the monster flees (runs away);
- otherwise, Monocarp fights the monster.

After every k-th fight with a monster (fleeing monsters do not count), Monocarp's level increases by 1. So, his level becomes 2 after k monsters he fights, 3 after 2k monsters, 4 after 3k monsters, and so on.

You need to process q queries of the following form:

- i~x: will Monocarp fight the i-th monster (or will this monster flee) if the parameter k is equal to x?

Input Format:
The first line contains two integers n and q (1<=n,q<=2*10^5) — the number of monsters and the number of queries.

The second line contains n integers a_1,a_2,...,a_n (1<=a_i<=2*10^5) — the levels of the monsters.

In the j-th of the following q lines, two integers i and x (1<=i,x<=n) — the index of the monster and the number of fights required for a level up in the j-th query.

Output Format:
For each query, output "YES", if Monocarp will fight the i-th monster in this query, and "NO", if the i-th monster flees.

Note:
None. Output only the code with no comments, explanation, or additional text.