#P5278. 算术天才⑨与等差数列

算术天才⑨与等差数列

Problem Description

Arithmetic Genius ⑨ really likes playing with arithmetic progressions.
One day, he gave you a sequence of length nn, where the ii-th number is aia_i.
He wants to test you. Each time, he will give a query l,r,kl, r, k and ask whether the numbers in the interval [l,r][l, r], after being sorted in increasing order, can form an arithmetic progression with common difference kk.
Of course, he will also keep modifying some element.
To avoid being looked down on by him, you must answer all queries quickly and correctly.
Note: A sequence with only one number is also an arithmetic progression.

Input Format

The first line contains two positive integers n,mn, m, representing the length of the sequence and the number of operations.
The second line contains nn integers, in order, representing each number in the sequence aia_i.
The next mm lines each start with a number op\text{op}.
If op=1\text{op} = 1, then two integers x,yx, y follow, meaning to modify axa_x to yy.
If op=2\text{op} = 2, then three integers l,r,kl, r, k follow, meaning a query.
In this problem, x,y,l,r,kx, y, l, r, k are all encrypted, and you need to decrypt them by XORing with the number of Yes you have output before.

Output Format

Output several lines. For each query, if it can form an arithmetic progression, output Yes; otherwise output No.

5 3
1 3 2 5 6
2 1 5 1
1 5 4
2 1 5 1
No
Yes

Hint

Constraints
For 100%100\% of the testdata, 1n,m3×1051 \le n, m \le 3 \times 10^5, and 0ai,y,k1090 \le a_i, y, k \le 10^9.

Translated by ChatGPT 5