SOLVE

LATER

Shil and Magic of Arrays

/

Shil has an array of **N** elements **A _{1}** ,

**1 i K**: Update the value of**A**to_{i}**K**i.e do**A**=_{i}**K****2 P**: Find the magical value of subarray**A**_{1}, A_{2}.... A_{P}

**Input:**

First line of input contains **N** and **Q** denoting length of array **A** and number of operations to be performed respectively.
Next **Q** lines consists of operations of type 1 or type 2 in the format mentioned above. Each element of array is initially initialized to **0**.

**Output:**

For each operation of type 2 , output the magical value modulo **10**^{9} + **7**.

**Constraints:**

- 1 ≤ N ≤ 2 * 10
^{5} - 1 ≤ Q ≤ 2 * 10
^{5} - 1 ≤ P, K ≤ N

Explanation

In first query , we update A_{3} to 6.

Answer for second query will be ( f[0]+1)^{(f[0]+1)} , thats 3^{3}

Answer for third query will be ( f[0]+1)^{(f[0]+1)} * ( f[6]+1)^{(f[6]+1)} , thats 8^{8} * 2^{2}

Time Limit:
4.0 sec(s)
for each input file.

Memory Limit:
512 MB

Source Limit:
1024 KB

Initializing Code Editor...