Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game takes place on an *h* × *w* field, and it is painted in two colors, but not like in chess. Almost all cells of the field are white and only some of them are black. Currently Gerald is finishing a game of giant chess against his friend Pollard. Gerald has almost won, and the only thing he needs to win is to bring the pawn from the upper left corner of the board, where it is now standing, to the lower right corner. Gerald is so confident of victory that he became interested, in how many ways can he win?

The pawn, which Gerald has got left can go in two ways: one cell down or one cell to the right. In addition, it can not go to the black cells, otherwise the Gerald still loses. There are no other pawns or pieces left on the field, so that, according to the rules of giant chess Gerald moves his pawn until the game is over, and Pollard is just watching this process.
The first line of the input contains three integers: *h*, *w*, *n* — the sides of the board and the number of black cells (1 ≤ *h*, *w* ≤ 10<sup class="upper-index">5</sup>, 1 ≤ *n* ≤ 2000). 

Next *n* lines contain the description of black cells. The *i*-th of these lines contains numbers *r*<sub class="lower-index">*i*</sub>, *c*<sub class="lower-index">*i*</sub> (1 ≤ *r*<sub class="lower-index">*i*</sub> ≤ *h*, 1 ≤ *c*<sub class="lower-index">*i*</sub> ≤ *w*) — the number of the row and column of the *i*-th cell.

It is guaranteed that the upper left and lower right cell are white and all cells in the description are distinct.
import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
from collections import Counter, deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

def Extended_Euclid(n,m):
    stack=[]
    while m:
        stack.append((n,m))
        n,m=m,n%m
    if n>=0:
        x,y=1,0
    else:
        x,y=-1,0
    for i in range(len(stack)-1,-1,-1):
        n,m=stack[i]
        x,y=y,x-(n//m)*y
    return x,y

class MOD:
    def __init__(self,mod):
        self.mod=mod
    
    def Pow(self,a,n):
        a%=self.mod
        if n>=0:
            return pow(a,n,self.mod)
        else:
            assert math.gcd(a,self.mod)==1
            x=Extended_Euclid(a,self.mod)[0]
            return pow(x,-n,self.mod)

    def Build_Fact(self,N):
        assert N>=0
        self.factorial=[1]
        for i in range(1,N+1):
            self.factorial.append((self.factorial[-1]*i)%self.mod)
        self.factorial_inv=[None]*(N+1)
        self.factorial_inv[-1]=self.Pow(self.factorial[-1],-1)
        for i in range(N-1,-1,-1):
            self.factorial_inv[i]=(self.factorial_inv[i+1]*(i+1))%self.mod
        return self.factorial_inv

    def Fact(self,N):
        return self.factorial[N]

    def Fact_Inv(self,N):
        return self.factorial_inv[N]

    def Comb(self,N,K):
        if K<0 or K>N:
            return 0
        s=self.factorial[N]
        s=(s*self.factorial_inv[K])%self.mod
        s=(s*self.factorial_inv[N-K])%self.mod
        return s

H,W,N=map(int,readline().split())
RC=[tuple(map(int,readline().split())) for i in range(N)]
RC.sort()
mod=10**9+7
MD=MOD(mod)
MD.Build_Fact(2*10**5)
dp=[0]*N
ans=MD.Comb(H+W-2,H-1)
for i in range(N):
    r,c=RC[i]
    dp[i]=MD.Comb(r+c-2,r-1)
    for j in range(i):
        dr=r-RC[j][0]
        dc=c-RC[j][1]
        dp[i]-=dp[j]*MD.Comb(dr+dc,dr)
        dp[i]%=mod
for i in range(N):
    r,c=RC[i]
    dr=H-r
    dc=W-c
    dp[i]*=MD.Comb(dr+dc,dr)
    dp[i]%=mod
ans-=sum(dp)
ans%=mod
print(ans)