Ridiculous Queries
A sequence of integers is called a permutation if the sequence contains each integer from to exactly once. For example, is a permutation. However, is not a permutation (it doesn't contain and contains ) and is not a permutation as well (it contains twice and doesn't contain ).
You are given a permutation .
Let . For example: and .
Your task is to answer queries. For a certain number , determine . In other words, determine the maximum value of where .
Input
The first line contains two integers and — the length of and the number of queries, respectively.
The next line contains integers () — elements of the permutation . It is guaranteed that is a permutation.
Each of the next lines contains a single integer .
Output
For each query, output the desired maximum.
Examples
Note
In the first example, we have a permutation .
The first query is , hence we must find
The second query is . The answer is
Scoring
( points): ;
( points): and ;
( points): ;
( points): for each pair there exists that ;
( points): ;
( points): ;
( points): no additional restrictions.