Problem: You are given sticks, numbered from to . The length of the -th stick is .
You need to answer queries. In each query, you are given two integers and (, ). Determine whether it is possible to choose distinct sticks from the sticks numbered to , to form non-degenerate triangles.
Input Format: The first line contains two integers and (, ) — the number of sticks and the number of queries respectively.
The second line contains integers () — denotes the length of the -th stick.
Each of the following lines contains two integers and (, ) — the parameters of each query.
Output Format: For each query, output "YES" (without quotes) if it is possible to form triangles, and "NO" (without quotes) otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
Note: In the first query, the lengths of the sticks are . Two sets of sticks and can be selected to form non-degenerate triangles.
In the second query, the lengths of the sticks are . It can be shown that it is impossible to form non-degenerate triangles.
In the third query, the lengths of the sticks are . Two sets of sticks and can be selected to form non-degenerate triangles.
In the fourth query, the lengths of the sticks are . It can be shown that it is impossible to form non-degenerate triangles.
In the fifth query, the lengths of the sticks are . Two sets of sticks and can be selected to form non-degenerate triangles.