Echo Inventory
A research station keeps an array of sample identifiers. The inventory of an interval is the multiset containing . The order of these values is ignored, but repeated values are kept with their multiplicities.
Two inventories of the same size are one-edit equivalent if at least one of the following conditions holds:
- Their multisets are equal.
- One occurrence with value can be selected from the first inventory and one occurrence with value can be selected from the second inventory so that, after discarding those two occurrences, the remaining multisets are equal.
Equivalently, changing at most one sample identifier in either inventory can make the two inventories equal. The change is only hypothetical and does not modify .
You must process point updates to and answer whether two specified interval inventories are one-edit equivalent.
Input
The first line contains two integers and (), the length of the array and the number of operations.
Output
For every operation of type , print YES if the two interval inventories are one-edit equivalent. Otherwise, print NO.
Samples
Sample 1
Input
6 7 1 2 2 4 2 3 2 1 3 4 6 2 1 2 5 6 1 6 1 2 1 2 5 6 2 2 4 3 5 1 3 8 2 1 3 4 6
Output
NO YES YES YES YES
The inventories in the first comparison have more than one unmatched occurrence, so the answer is NO. The second comparison has one unmatched occurrence on each side. After setting to , the third comparison contains equal inventories. The fourth comparison also contains equal inventories in different orders. After setting to , the final comparison has only the occurrences and unmatched.