At Narxoz University, the faculties are not just departments — they're part of a living, evolving structure.
There are $$$n$$$ faculties, arranged in a circular building. That means faculty $$$0$$$ is a neighbor of $$$n - 1$$$. Each faculty has a type — maybe it's economics, business, or even magic accounting — and each type is represented by an integer.
The university is equipped with high-tech portals that let you instantly travel between any two faculties of the same type.
But sometimes that's not enough. So you're allowed to build corridors between neighboring faculties — that is, between faculty $$$i$$$ and $$$(i + 1)$$$ $$$mod$$$ $$$n$$$. Once built, you can walk back and forth through them.
Also, faculties love to rebrand themselves. A faculty can suddenly change its type (maybe they switched to crypto-finance).
You'll receive $$$q$$$ requests — each being one of the following:
Your task is to answer for each query of type 3, print YES if such travel is possible, or NO otherwise.
The first line contains two integers $$$n$$$ and $$$q$$$ — the number of faculties and the number of queries, respectively ($$$1 \le n, q \le 10^5$$$).
The second line contains $$$n$$$ integers: $$$t_0, t_1, ..., t_{n-1}$$$ — the initial types of the faculties ($$$0 \le t_i \lt 10^{18}$$$).
Each of the following $$$q$$$ lines describes a query in one of the following formats:
All queries of type $$$2$$$ are unique.
For each query of type $$$3$$$, print YES if $$$b$$$ can be reached from $$$a$$$ , otherwise NO.
3 3 0 0 2 2 2 3 0 2 1 0 0
YES
10 9 2 1 0 1 2 1 2 0 2 2 2 6 1 5 3 2 5 1 5 4 3 0 6 1 9 3 2 2 2 7 3 9 3
YES NO
| Name |
|---|


