You are playing a board game with squares numbered from to (inclusive) and tokens numbered from to . Each token is located in one of the squares, and multiple tokens might be located in the same square. Initially, token is located in square . The distance of the two tokens is the difference between the square number where the first token is located and the square number where the second token is located.
For a set of tokens , we would like to check whether the tokens are well-separated as follows:
Let be the list of tokens in sorted by increasing order of square number where the token is located. If several tokens are located in the same square, then these tokens are sorted by increasing order of token number.
If there are less than three tokens in , then the tokens are well-separated.
Otherwise, the tokens are well-separated if and only if the distance between two neighbouring tokens in is the same. Two tokens are neighbouring if their indices in differ by one.
You would like to perform operations of either one of these types:
Move token to square .
Report whether the set of tokens numbered from to (inclusive) are well-separated.
输入格式
Input begins with a line containing two integers: (; ) representing the number of tokens and the number of operations, respectively. The next line contains integers: () representing the initial square location of the tokens. The next lines each contains one of the following input format representing the operation you should perform.
(; )
Move token to square .
()
Output whether the set of tokens numbered from to (inclusive) are well-separated.
There will be at least one operation of the second type.
输出格式
For each operation of the second type in the same order as input, output in a line a string "YES" (without quotes) or "NO" (without quotes) whether the set of tokens numbered from to (inclusive) are well-separated.