Platforms of the New Babylon#8799

Platforms of the New Babylon

1 second
64 megabytes
Medium

Kostya, using his map, finally reached the new Babylon.

In the center of the city, he found platforms.

To investigate the legend about the fall of the new Babylon, he needs to explore these platforms.

The height of the -th platform is denoted as h_i. You can move between platforms if at least one of the following conditions is met (1 \le i, j \le n):

  1. Platforms and have the same height.

  2. Platforms and are adjacent (i.e., |i-j| = 1) and the height difference |h_i - h_j| is less than or equal to .

Kostya asks questions of the form : is it possible to reach platform from platform ?

Input

The first line contains integers , , and (1 \le n, q \le 2 \cdot 10^5).

The second line contains integers — the array (1 \le h_i \le 3 \cdot 10^6).

Each of the next lines contains two integers: the questions.

Output

For each question, output the answer.

Examples

Example 1

Loading
Loading