#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#define fo(i,a,b) for (int i=a;i<=b;i++)
#define fd(i,a,b) for (int i=a;i>=b;i--)
#define N 1005
#define mo 1000000007
using namespace std;
struct node
{
int x,y;
}a[N];
int n,m,k,Ans,Sum;
typedef long long ll;
bool cmp(node a,node b)
{
return a.x < b.x;
}
int read(int &n)
{
char ch = ' ';
int q = 0,w = 1;
for (;(ch != '-') && ((ch < '0' || ch > '9'));ch = getchar());
if (ch == '-') w = -1,ch = getchar();
for (;ch >= '0' && ch <= '9';ch = getchar()) q = q * 10 + ch - 48;
n = q * w;
return n;
}
int main()
{
freopen("count.in","r",stdin);
freopen("count.out","w",stdout);
read(n),read(m),read(k);
fo(i,1,k) read(a[i].x),read(a[i].y);
sort(a + 1,a + k + 1,cmp);
a[0].x = 0;
a[k + 1].x = n + 1;
fo(i,1,k)
{
int l = 0,r = m + 1;
fd(j,i - 1,0)
{
Sum = (Sum + (ll)(a[i].y - l) * (r - a[i].y) % mo * (a[j + 1].x - a[j].x) % mo) % mo;
if (a[j].y <= a[i].y) l = max(l,a[j].y);
if (a[i].y <= a[j].y) r = min(r,a[j].y);
}
Ans = (Ans + (ll)Sum * (a[i + 1].x - a[i].x) % mo) %mo;
}
printf("%d\n" , Ans % mo);
}