AT_aalc001_w 隣接加算
Description
For a sequence of integers $ B=(B_1,B_2,\ldots,B_k) $ of length $ k $ , consider performing the following operation $ 0 $ or more times:
- Choose an integer $ i $ satisfying $ 1 \le i \le k-1 $ and an integer $ x $ ( $ x $ may be negative).
- Add $ x $ to $ B_i $ and $ 2x $ to $ B_{i+1} $ .
We call $ B $ a **good sequence** if all elements of $ B $ can be made equal by these operations.
You are given a sequence of nonnegative integers $ A=(A_1,A_2,\ldots,A_N) $ of length $ N $ . Process $ Q $ queries. Each query is of one of the following $ 2 $ types:
- `1 i x`: Change $ A_i $ to $ x $ .
- `2 l r`: Determine whether the sequence $ (A_l,A_{l+1},\ldots,A_r) $ is a good sequence.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ Q $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $ $ \mathrm{query}_1 $ $ \mathrm{query}_2 $ $ \vdots $ $ \mathrm{query}_Q $
Each query is given in one of the following formats:
> $ 1 $ $ i $ $ x $
> $ 2 $ $ l $ $ r $
Output Format
Let $ q $ be the number of type $ 2 $ queries. Print $ q $ lines. On the $ j $ -th line, print `Yes` if the sequence $ (A_l,A_{l+1},\ldots,A_r) $ in the $ j $ -th type $ 2 $ query is a good sequence, and `No` otherwise.
Explanation/Hint
### Sample Explanation 1
The sequence obtained in the first type $ 2 $ query is $ (1) $ . All its elements are already equal without any operations, so it is a good sequence.
The sequence obtained in the $ 2 $ -nd type $ 2 $ query is $ (1,2) $ . Performing an operation with $ i=1,x=-1 $ gives $ (0,0) $ , so it is a good sequence.
### Constraints
- $ 1 \le N \le 2 \times 10^5 $
- $ 1 \le Q \le 2 \times 10^5 $
- $ 0 \le A_i \le 10^9 $
- For type $ 1 $ queries, $ 1 \le i \le N $ , $ 0 \le x \le 10^9 $
- For type $ 2 $ queries, $ 1 \le l \le r \le N $
- All numerical values in the input are integers.