#P5278. 算术天才⑨与等差数列
算术天才⑨与等差数列
Problem Description
Arithmetic Genius ⑨ really likes playing with arithmetic progressions.
One day, he gave you a sequence of length , where the -th number is .
He wants to test you. Each time, he will give a query and ask whether the numbers in the interval , after being sorted in increasing order, can form an arithmetic progression with common difference .
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 , representing the length of the sequence and the number of operations.
The second line contains integers, in order, representing each number in the sequence .
The next lines each start with a number .
If , then two integers follow, meaning to modify to .
If , then three integers follow, meaning a query.
In this problem, 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 of the testdata, , and .
Translated by ChatGPT 5