# Prefix and Suffix

Intra AUST Programming Co...
Limits 2s, 256 MB

Initially, you are given an empty array $A$. You have to perform the following queries.

$1$ $P$ - Add an integer $P$ at the beginning of the array.

$2$ $Q$ - Add an integer $Q$ at the end of the array.

$3$ $X$ $Y$ - How many times does the subarray of length $(Y-X+1)$ consisting of $X$th index to $Y$th index exist in the whole array. For example, if there is an array $A[2,2,2,3,4,5,2,2]$ and subarray of length $2$ from index $2$ to index $3$ is$[2,2]$ then this subarray exist $3$ times in the main array.

$4$ $X$ $Y$ - Is the subarray $[X….Y]$ is same as the reverse of that subarray? That means, Is $A[X,X+1,,Y-1,Y]$ is the same as $A[Y,Y-1,..,X-1,X]$? Print $“Yes”$ or $“No”$ based on your answer. For example, if there is an array $A[2,2,2,3,4,5,2,2]$ then subarray of index $1$ to $3$ is same as the reverse of that subarray, while subarray of index $3$to $5$ and $1$to $6$ is not.

## Input

First line of input consists of the number of queries $N(1<=N<=5*10^5)$. Then next $N$ lines have the queries described above. The Maximum length of the array does not exceed $5*10^5$.

$0<=P,Q<=10^9$

$1<=X<=Y<=$ length of the array at current moment

## Output

For each query of types 3 and 4 print the query result. See sample output for more details.

## Sample

InputOutput
6
1 4
2 4
3 1 2
2 4
4 1 3
3 1 2

1
Yes
2