An array of integers is called a permutation if it contains each number from to exactly once. For example, the following arrays are permutations: and . The following arrays are not permutations: .
You are given an array of elements and queries. These queries are of two types:
means, if holds permutation, then print YES. Otherwise, print NO.
means, set
The first line contains two integer and the size of the array and the number of queries.
The second line contains integer .
The next lines contain two types of queries.
For every query of type , print YES if to holds a permutation. Otherwise, print NO.
Input | Output |
---|---|
5 4 2 1 3 4 5 1 1 5 2 4 3 1 1 5 1 1 3 | YES NO YES |
Initially, the array looks like this [2,1,3,4,5]. After the second query, the array becomes [2,1,3,3,5]. |