Number of elements in unimodal sequence#10868

Number of elements in unimodal sequence

2 seconds
128 megabytes
Easy

Sequence a_i is called unimodal if there exists such index that a_1 < a_2 < \ldots < a_p and a_p > a_{p+1} > \ldots > a_n. For the given value of find how many times it appears in array.

Input

The first line contains the size of array and number of queries q~(n, q \le 10^6). The next line contains positive integers that represent a unimodal sequence. Each of the next lines contains value of . Numbers in array do not exceed 10^9.

Output

For each value of print in a separate line the number of times it appears in array.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading