#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
const int MOD = 1000000007;
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef long long LL;
#define MAXN 1010
int px[MAXN], py[MAXN];

inline int powMod(int x, int n){
    int res = 1;
    for(; n; n>>=1, x = (LL)x * x % MOD)
        if (n&1) res = (LL)res * x % MOD;
    return res;
}

inline int inv(int x){
    return powMod(x, MOD-2);
}

const int inv4 = inv(4);
inline int totn(int n, int m){
    return (LL)n * m % MOD * (n+1) % MOD * (m+1) % MOD * inv4 %MOD;
}

void uni(VI &a){
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
}

int pos(int x, const VI &xx){
    return lower_bound(xx.begin(), xx.end(), x) - xx.begin();
}

inline int calc(int n){
    return (LL)n * (n+1) / 2 % MOD;
}

int main()
{
    int n, m, k;
    while(scanf("%d%d%d", &n, &m, &k)==3){
        VI xx(2*k), yy(2*k);
        REP(i, k){
            scanf("%d%d", px+i, py+i);
            xx[i] = px[i]; xx[i+k] = px[i] + 1;
            yy[i] = py[i]; yy[i+k] = py[i] + 1;
        }
        xx.pb(0); xx.pb(1); xx.pb(n+1);
        yy.pb(0); yy.pb(1); yy.pb(m+1);
        uni(xx);  uni(yy);
        int tot = totn(n, m);
        int res = 0;
        vector<VI> g(xx.size(), VI(yy.size(), 1) );
        REP(i, k){
            px[i] = pos(px[i], xx);
            py[i] = pos(py[i], yy);
            g[px[i]][py[i]] = 0;
        }
        REP(i, xx.size()) g[i][0] = g[i][yy.size()-1] = 0;
        REP(j, yy.size()) g[0][j] = g[xx.size()-1][j] = 0;
        REP(i, xx.size()){
            for(int j = yy.size()-1, len = 0; ~j; j--){
                int dy = yy[j+1] - yy[j];
                if (g[i][j]){
                    if(dy == 1) g[i][j] = (len += dy);
                    else g[i][j] = len, len += dy;
                } else len = 0;
            }
        }
        int num = 0;
        for(int j = 1; j < yy.size()-1; j++){
            int sum = 0;
            vector<PII> q;
            q.pb(mp(0, 1));
            q.pb(mp(0, 1));
            for(int i = 1; i < xx.size(); i++){
                PII curr = mp(g[i][j], i==xx.size()-1? 1 : xx[i+1] - xx[i]);
                while(q.size()>=2 && curr.first <= q.back().first){
                    int mh = max(curr.first, q[q.size()-2].first);
                    sum = (sum + (q.back().first - mh) * (LL)calc(q.back().second)) % MOD;
                    if(curr.first >= q[q.size()-2].first){
                        curr.second += q.back().second;
                        q.pop_back();
                    } else {
                        q[q.size()-2].second += q.back().second;
                        q.pop_back();
                    }
                }
                q.pb(curr);
            }
            num = (num + (LL)sum * (yy[j+1] - yy[j])) % MOD;
            if (yy[j+1] - yy[j] > 1) num = (num + totn(yy[j+1] - yy[j], n)) % MOD;
        }
        //printf("tot=%d, num=%d\n", tot, num);
        int ans = (tot - num + MOD) % MOD;
        printf("%d\n", ans);
    }
}
