#include <bits/stdc++.h>
#define rf(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);
#define pb push_back
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define befv(V) ((V)[(sz(V)-2)])
#define allv(V) ((V).begin()),((V).end())
#define sorv(V) sort(allv(V))
#define revv(V) reverse(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define clv(V) (V).clear()
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

const int MOD = 1000000007;
const int MAXN = 35;
const int MAXX = 1000055;

inline void add(int &a, int b) { a += b; if(MOD <= a) a -= MOD; }

vector<pii> YV, XV;

int S[MAXX];

int C[MAXN*2][MAXN*2], D[MAXN*2][MAXN*2];
int fac[MAXX], rfac[MAXX];

int A[MAXN], B[MAXN];

int H, W, N, Ans;

int pw(int n, int k) {
	int r = 1; for(; k; k >>= 1) {
		if(k & 1) r = ll(r) * n % MOD;
		n = ll(n) * n % MOD;
	}
	return r;
}

int main() {
	ios::sync_with_stdio(false);
	fac[0] = 1; for(int i = 1; i < MAXX; i++) fac[i] = ll(fac[i-1]) * i % MOD;
	rfac[MAXX-1] = pw(fac[MAXX-1], MOD-2);
	for(int i = MAXX-1; i; i--) rfac[i-1] = ll(rfac[i]) * i % MOD;

	cin >> H >> W >> N;
	for(int i = 1; i <= N; i++) {
		cin >> A[i] >> B[i];
		A[i]++; B[i]++;
	}

	{
		vector<int> V;
		for(int i = 1; i <= N; i++) V.eb(A[i]);
		sorv(V); univ(V);

		if(1 < V[0]) YV.eb(1, V[0]-1);
		for(int i = 0, n = sz(V); i < n; i++) {
			YV.eb(V[i], V[i]);
			if(i+1 < n && V[i]+1 <= V[i+1]-1)
				YV.eb(V[i]+1, V[i+1]-1);
		}
		if(V.back() < H) YV.eb(V.back()+1, H);
	}
	{
		vector<int> V;
		for(int i = 1; i <= N; i++) V.eb(B[i]);
		sorv(V); univ(V);

		if(1 < V[0]) XV.eb(1, V[0]-1);
		for(int i = 0, n = sz(V); i < n; i++) {
			XV.eb(V[i], V[i]);
			if(i+1 < n && V[i]+1 <= V[i+1]-1)
				XV.eb(V[i]+1, V[i+1]-1);
		}
		if(V.back() < W) XV.eb(V.back()+1, W);
	}

	for(int i = 1; i <= N; i++) S[A[i]]++;
	for(int i = 1; i <= H; i++) S[i] += S[i-1];
	for(auto &v : YV) {
		int s, e; tie(s, e) = v;
		if(s == e) continue;
		int ret = 0;
		for(int i = s; i < e; i++) {
			int lc = (ll(W) * i - S[i]) % MOD;
			int rc = (ll(H) * W - N - lc) % MOD;
			ret = (ll(lc) * rc + ret) % MOD;
		}
		add(Ans, ret);
	}
	fill(S, S+H+1, 0);

	for(int i = 1; i <= N; i++) S[B[i]]++;
	for(int i = 1; i <= W; i++) S[i] += S[i-1];
	for(auto &v : XV) {
		int s, e; tie(s, e) = v;
		if(s == e) continue;
		int ret = 0;
		for(int i = s; i < e; i++) {
			int lc = (ll(H) * i - S[i]) % MOD;
			int rc = (ll(H) * W - N - lc) % MOD;
			ret = (ll(lc) * rc + ret) % MOD;
		}
		add(Ans, ret);
	}

	H = sz(YV); W = sz(XV);
	for(int i = 0; i < H; i++) for(int j = 0; j < W; j++)
		C[i][j] = ll(YV[i].second - YV[i].first + 1) * (XV[j].second - XV[j].first + 1) % MOD;
	for(int i = 1, y, x; i <= N; i++) {
		y = int(lower_bound(allv(YV), pii(A[i], A[i])) - YV.begin());
		x = int(lower_bound(allv(XV), pii(B[i], B[i])) - XV.begin());
		C[y][x] = 0;
	}

	for(int i = 0; i < H; i++) for(int j = 0; j < W; j++) if(C[i][j]) {
		for(int k = 0; k < H; k++) fill(D[k], D[k]+W, 0);
		queue<pii> PQ; D[i][j] = 1; PQ.push(pii(i, j));
		for(int y, x, dst; !PQ.empty(); PQ.pop()) {
			tie(y, x) = PQ.front();
			dst = D[y][x] + 1;
			for(int dr = 0, ny, nx; dr < 4; dr++) {
				ny = y+dy[dr]; nx = x+dx[dr];
				if(ny < 0 || nx < 0 || H <= ny || W <= nx || !C[ny][nx] || D[ny][nx]) continue;
				D[ny][nx] = dst;
				PQ.push(pii(ny, nx));
			}
		}

		for(int y = 0; y < H; y++) for(int x = 0; x < W; x++) {
			int ret = C[i][j];
			ret = ll(ret) * C[y][x] % MOD;
			ret = ll(ret) * (D[y][x]-1) % MOD;
			ret = ll(ret) * rfac[2] % MOD;
			add(Ans, ret);
		}
	}

	cout << Ans << endl;
	return 0;
}

Measured memory_bytes: 12032