For this Question: Given an array, A of size N and Q queries of two types:
1 U X - change the value at index U to X
2 L R - print the sum of elements in the range L to R.
Print a single integer corresponding to every query of type 2.The first line of input contains two integers N and Q denoting the number of elements in the array and type of queries respectively. The next line contains N integers denoting the elements of the array A. The next Q lines contain three integers T L R denoting the queries.

1 <= N, Q <= 100000
1 <= A[i] <= 100000
1 <= T <= 2
1 <= U, X <= 100000
1 <= L <= R <= 100000Print a single integer corresponding to every query of type 2 in a separate line. Since the answer can be large print ans modulo (10^9 + 7)Sample Input:
5 6
2 1 3 5 4
2 3 5
1 2 7
1 4 2
2 2 4
1 5 3
2 1 5

Sample Output:
12
12
17

Explanation:
Array after 2nd query: [2, 7, 3, 5, 4]
Array after 3rd query: [2, 7, 3, 2, 4]
Array after 5th query: [2, 7, 3, 2, 3], I have written this Solution Code: #include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N], t[4*N];

void build(int nd, int s, int e){
    if(s == e)
        t[nd] = a[s];
    else{
        int md = (s + e) >> 1;
        build(nd << 1, s, md);
        build(nd << 1 | 1, md+1, e);
        t[nd] = t[nd << 1] + t[nd << 1 | 1]; 
    }
}

void upd(int nd, int s, int e, int id, int v){
    if(s == e){
        t[nd] = v;
        return;
    }
    int md = (s + e) >> 1;
    if(id <= md)
        upd(nd << 1, s, md, id, v);
    else
        upd(nd << 1 | 1, md+1, e, id, v);
    t[nd] = t[nd << 1] + t[nd << 1 | 1];
}

int query(int nd, int s, int e, int l, int r){
    if(s > e || s > r || e < l)
        return 0;
    if(s >= l && e <= r)
        return t[nd];
    int md = (s + e) >> 1;
    return query(nd << 1, s, md, l, r) + 
            query(nd << 1 | 1, md+1, e, l, r);
}

void solve(){
    int n, q;
    cin >> n >> q;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    build(1, 1, n);
    while(q--){
        int t, l, r;
        cin >> t >> l >> r;
        if(t == 1)
            upd(1, 1, n, l, r);
        else
            cout << query(1, 1, n, l, r) % mod << endl;
    }
}

void testcases(){
    int tt = 1; 
    //cin >> tt;
    while(tt--){
        solve();
    }
}

signed main() {
    IOS;
        clock_t start = clock();

    testcases();

    cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms:";
    return 0;
}   , In this Programming Language: C++, Now tell me if this Code is compilable or not?