#include <iostream>
#include <vector>
using namespace std;

long long Mod = 1e9 + 7;
int N, K, Q;

int main()
{
	cin >> N >> K >> Q;

	vector<int> A(N);
	for (int i = 0; i < N; i++)
		cin >> A[i];

	vector<vector<long long>> startingPaths(N, vector<long long>(K+1, 1));
	vector<vector<long long>> endingPaths(N, vector<long long>(K+1, 1));
	vector<vector<long long>> totalPaths(N, vector<long long>(K + 1, 0));

	for (int k = 1; k <= K; k++){
		for (int i = 0; i < N; i++){
			long long val = 0;
			if (i - 1 >= 0)
				val += startingPaths[i - 1][k - 1];
			if (i + 1 < N)
				val += startingPaths[i + 1][k - 1];
			startingPaths[i][k] = val%Mod;
		}
	}

	for (int k = 1; k <= K; k++){
		for (int i = 0; i < N; i++){
			long long val = 0;
			if (i - 1 >= 0)
				val += endingPaths[i - 1][k - 1];
			if (i + 1 < N)
				val += endingPaths[i + 1][k - 1];
			endingPaths[i][k] = val%Mod;
		}
	}

	for (int i = 0; i < N; i++){
		long long total = 0;
		for (int j = 0; j <= K; j++){
			total += endingPaths[i][j] * startingPaths[i][K - j];
			total %= Mod;
		}
		totalPaths[i][K] = total;
	}

	long long totalVal = 0;
	for (int i = 0; i < N; i++){
		totalVal += A[i] * totalPaths[i][K];
		totalVal %= Mod;
	}

	for (int q = 0; q < Q; q++){
		int indx, newVal;
		cin >> indx >> newVal;
		indx--;

		totalVal = totalVal + Mod - (A[indx] * totalPaths[indx][K]) % Mod;
		A[indx] = newVal;
		totalVal += A[indx] * totalPaths[indx][K];
		totalVal %= Mod;
		cout << totalVal << endl;
	}

	return 0;
}