#include <bits/stdc++.h>
// #define int long long
#define ff first
#define ss second
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ti tuple<int, int, int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define teto(a, b) (((a)+(b)-1)/(b))
#define all(x) x.begin(), x.end()
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define dbg(msg, var) cerr << msg << " " << var << endl;
 
using namespace std;
 
const int MAX = 1e6+10;
const ll MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-8;
const ld PI = acos(-1);

// End Template //

// ll dp[5010][5010];
vector<vl> dp(5010, vl(5010, -1));
ll n, k, q, p, x;

ll solve(int i, int t){
    if(i<0 or i>=n) return 0;
    if(t==0) return 1;
    if(dp[i][t]!=-1) return dp[i][t];
    dp[i][t] = (solve(i-1, t-1) + solve(i+1, t-1))%MOD;
    return dp[i][t];
}

int32_t main()
{sws;

    // memset(dp, -1, sizeof(dp));
    cin >> n >> k >> q;
    vl a(n);
    vl times(n, 0);
    ll sum = 0;

    for(int i=0;i<n;i++)
        for(int j=0;j<=k;j++)
            times[i] = (times[i] + (solve(i, j)*solve(i, k-j))%MOD)%MOD;

    // for(int i=0;i<n;i++,cout<<endl)
    //     for(int j=0;j<=k;j++)
    //         cout << dp[i][j] << " ";

    for(int i=0;i<n;i++)
        cin >> a[i];
    for(int i=0;i<n;i++)
        sum = (sum + times[i]*a[i])%MOD;
    
    while(q--){
        cin >> p >> x; p--;
        sum = (sum-(times[p]*a[p])%MOD+MOD)%MOD;
        sum = (sum + (times[p]*x)%MOD)%MOD;
        a[p] = x;
        cout << sum << endl;
    }


    return 0;
}