Balanced Seesaw Array

아직 제출이 없습니다시간 제한3초메모리 제한1024 MB

문제

Bob likes to play seesaw. He thinks that it would be really funny if the seesaw is in a balanced state. It means that the seesaw is not tilted to the left and right. After playing the seesaw, Bob thinks about a problem related to the balanced seesaw.

Let A=\[a_1,a_2,,a_m]A = \[a\_1, a\_2, \dots , a\_m] denote an array of length mm. Bob thinks that \[a_1,a_2,,a_m]\[a\_1, a\_2, \dots , a\_m] is a balanced seesaw array if there exists an integer kk between 11 to mm such that _i=1m(ik)a_i=0\sum\_{i=1}^{m}{(i-k)a\_i} = 0.

Bob gets an array A=\[a_1,a_2,,a_n]A = \[a\_1, a\_2, \dots , a\_n] as his birthday gift, and he is curious about whether some non-empty subarray is a balanced seesaw array. More formally, he is interested in whether \[a_,a_+1,,a_r]\[a\_ℓ , a\_{ℓ+1}, \dots , a\_r] is a balanced seesaw array for some specified pair (,r)(ℓ, r) where 1rn1 ≤ ℓ ≤ r ≤ n. Bob also finds that the elements in its array will change by time, it will have the following two types of changes.

  1. a_,a_+1,,a_ra\_ℓ , a\_{ℓ+1}, \dots , a\_r are increased by xx.
  2. a_,a_+1,,a_ra\_ℓ , a\_{ℓ+1}, \dots , a\_r are changed to xx.

For convenience, Bob will give you the array A=\[a_1,a_2,,a_n]A = \[a\_1, a\_2, \dots , a\_n] first. Then, there are qq operations. Each operation will be one of the following three types.

  • 11 rr xx: means that a_,a_+1,,a_ra\_ℓ , a\_{ℓ+1}, \dots , a\_r are increased by xx.
  • 22 rr xx: means that a_,a_+1,,a_ra\_ℓ , a\_{ℓ+1}, \dots , a\_r are changed to xx.
  • 33 rr: means that Bob is curious about whether the subarray \[a_,a_+1,,a_r]\[a\_ℓ , a\_{ℓ+1}, \dots , a\_r] is a balanced seesaw array. You should output “Yes” or “No” for each operation type 3.

입력

The first line of input contains two integers nn and qq. nn is the length of the array, and qq is the number of operations. The second line contains nn integers a_ia\_i to define the array. Each of the following qq lines is an operation described in the problem statement.

출력

Please output “Yes” or “No” to indicate whether \[a_,a_+1,,a_r]\[a\_ℓ , a\_{ℓ+1}, \dots , a\_r] is a balanced seesaw array for each type 3 operation.

제한

  • 1n1000001 ≤ n ≤ 100000
  • 1q12000001 ≤ q ≤ 1200000
  • 1000a_i1000-1000 ≤ a\_i ≤ 1000
  • 10000x10000-10000 ≤ x ≤ 10000
  • For 1in1 ≤ i ≤ n, you may assume that a_i1.5×109|a\_i | ≤ 1.5 × 10^9 after any operation.
  • 1rn1 ≤ ℓ ≤ r ≤ n