#include <bits/stdc++.h>
#define ll long long
#define real long double
#define fr(i,l,n) for(ll i=l;i<n;i++)
#define br cout<<"\n"
#define al(fu) (fu).begin(), (fu).end()
#define prl(c) cout<<(c)<<"\n"
#define prv(v) {fr(qz,0,v.size()) cout<<(v)[qz]<<' '; br;}
#define alr(fu) (fu).rbegin(), (fu).rend()
#define mod 1000000007LL
#define mod1 998244353LL
#define nfi 1000000000000000013LL
#define skoree ios::sync_with_stdio(0); cin.tie(0)
#define danet(b) cout<<(b?"YES":"NO")
#define Danet(b) cout<<(b?"Yes":"No")
using namespace std;

int main(){
    skoree;
    ll tr=1;
    //cin>>tr;
    while(tr--){
        ll n,k,q;
        cin>>n>>k>>q;
        vector<ll> a(n),g(n);
        fr(i,0,n) cin>>a[i];
        ll d[k+1][n];
        fr(i,0,n) d[k][i]=1;
        for(ll j=k-1; j>=0; j--){
            d[j][0]=d[j+1][1];
            d[j][n-1]=d[j+1][n-2];
            fr(i,1,n-1) d[j][i]=(d[j+1][i-1]+d[j+1][i+1])%mod;
        }
        fr(j,0,k+1){
            fr(i,0,n) g[i]=(g[i]+d[j][i]*d[k-j][i])%mod;
        }
        ll c=0;
        fr(i,0,n) c=(c+g[i]*a[i])%mod;
        while(q--){
            ll h,x;
            cin>>h>>x;
            c=(c+mod-(g[h-1]*a[h-1])%mod)%mod;
            a[h-1]=x;
            c=(c+g[h-1]*a[h-1])%mod;
            prl(c);
        }
    }
    return 0;
}
/*
7
1
2
3
4
5
6
7

*/
