Problem: Nobody knows, but N frogs live in Chef's garden.
Now they are siting on the X-axis and want to speak to each other. One frog can send a message to another one if the distance between them is less or equal to K. 
Chef knows all P pairs of frogs, which want to send messages. Help him to define can they or not! 
Note : More than 1 frog can be on the same point on the X-axis.
 

Input

The first line contains three integers N, K and P. 
 The second line contains N space-separated integers A1, A2, ..., AN denoting the x-coordinates of frogs". 
 Each of the next P lines contains two integers A and B denoting the numbers of frogs according to the input. 

 

Output

For each pair print "Yes" without a brackets if frogs can speak and "No" if they cannot. 

 

Constraints

1 ≤ N, P ≤ 10^5
0 ≤ Ai, K ≤ 10^9
1 ≤ A, B ≤ N

 

Example
Input:
5 3 3
0 3 8 5 12
1 2
1 3
2 5

Output:
Yes
Yes
No

 


Explanation
For pair (1, 2) frog 1 can directly speak to the frog 2 as the distance between them is 3 - 0 = 3 <= K . 
For pair (1, 3) frog 1 can send a message to frog 2, frog 2 can send it to frog 4 and it can send it to frog 3.
For pair (2, 5) frogs can't send a message under current constraints.

Solution (in PYTHON):

Solution:
import sys

def union(subsets, x, y):

    px = find(subsets,x)
    py = find(subsets,y)

    subsets[px] = py

def find(subsets,i):

    if i == subsets[i]:
        return i

    return find(subsets, subsets[i])

def unionFind(K, pos):
    subsets = [0]*len(pos)

    for i in range(len(pos)):
        subsets[i] = i
    
    
    pos_sort_l = sorted(enumerate(pos), key=lambda x: x[1])

    i = 0

    while i < len(pos) - 1:

        if( (pos_sort_l[i + 1][1] - pos_sort_l[i][1]) <= K ):
            union(subsets, pos_sort_l[i + 1][0], pos_sort_l[i][0])

        i = i + 1

    return subsets
    
def ans_query(subsets, x1, x2):

    px1 = find(subsets, x1)
    px2 = find(subsets, x2)

    if(px1 == px2):
        return "Yes"
    else:
        return "No"
        

l1 = raw_input()

ls1 = l1.split()

N = int(ls1[0])
K = int(ls1[1])
P = int(ls1[2])

l2 = raw_input()

ls2 = l2.split()

pos = []

for x in ls2:
    pos.append(int(x))

# ans P queries
subsets = unionFind(K,pos)

while P > 0:
    ll = raw_input()
    lls = ll.split()
    x1 = int(lls[0])
    x2 = int(lls[1])
    print ans_query(subsets, x1 - 1, x2 - 1)
    P = P - 1