You are given array A of n integers.
There are q queries, each of the form (l,r), count the number of distinct values in the subarray Al,Al+1,...,Ar.
### Input
- The first line contains 2 integers n,q.
- The second line contains n integers Ai.
- The next q lines, each line contains 2 integers li,ri, a query.
### Output
- Print q integers, the answers to q queries.
### Constraints
- 1≤n,q≤105.
- 1≤Ai≤105.
### Example
Input:
5312232131534
Output:
232