Initially, you are given an empty array . You have to perform the following queries.
- Add an integer at the beginning of the array.
- Add an integer at the end of the array.
- How many times does the subarray of length consisting of th index to th index exist in the whole array. For example, if there is an array and subarray of length from index to index is then this subarray exist times in the main array.
- Is the subarray is same as the reverse of that subarray? That means, Is is the same as ? Print or based on your answer. For example, if there is an array then subarray of index to is same as the reverse of that subarray, while subarray of index to and to is not.
First line of input consists of the number of queries . Then next lines have the queries described above. The Maximum length of the array does not exceed .
length of the array at current moment
For each query of types 3 and 4 print the query result. See sample output for more details.
Input | Output |
---|---|
6 1 4 2 4 3 1 2 2 4 4 1 3 3 1 2 | 1 Yes 2 |