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.
/*
     D    A    R    K    L      _                 _         O    R    D    D    A    
         K                    / |                 | \        L    O    R         D   
        A         R         _ / |                 | \ _       K    L         O    R  
  D         A    R    K     _ / |         _       | \ _        L    O    R    D    D 
      R    K    L       _ / _   |       _ | \\    |   _ \       O    R    D    D     
     R         K        _ / _   |       _ | \ \   |   _ \        L    O    R         
    D    A    R     _ / _ / |   /     /         \ \   | \ _ \ _        K    L    O   
   D    D           _ / _ / |   /     /          \ \   | \ _ \ _             A       
       K        _ / _ /     | /     /     _       \ \ |     \ _ \ _      L    O    R 
 D    A        _ / _ /      | /     /     _       \ \ |      \ _ \ _      R         K
            _ / _ /         | |     |   |   \ (O) / | |         \ _ \ _         O    
    D      _ / _ /          | |     |   |    \   /  | |          \ _ \ _         D   
   A      / _ /     |   |   | \     |   \ _   \|/   / |   |   |     \ _ \            
  K      / _ /      |   |   | \     |   \ _    V    / |   |   |      \ _ \         L 
        / /         |   |   |   \ _ /       \ _ _ /   |   |   |         \ \          
       / /          |   |   |                         |   | | |          \ \         
      / /       |   | | \     \       ROWECHEN      /     / | |   |       \ \        
     / /    _ _ |   | | \     \        ZHONG        /     / | |   | _ _    \ \       
    / / _ /   \ | | | |   \ / \ \                 / / \ /   | | | | /   \ _ \ \      
   / / _ /    \ | | | |       \ \                 / /       | | | | /    \ _ \ \     
  / / /         \ \ \ \ /       /                 \       \ / / / /         \ \ \    
 \ / /          \ \ \ \ /       /                 \       \ / / / /          \ \ /   
  \|/             \|/         |         |         |           \|/             \|/    
  L         O     \|/         |         |   |     |           \|/        R    D      
 A    R    K    L             / _ |     |   | _     \      O    R    D    D    A    R
     L    O         R         / _ |     |   | _     \       D    D         A    R    
    L    O    R    D        / / / _     | _ | | \ _   \      D    A    R         K   
   O    R    D              / / / _ |   | _ | | \ _   \       D    A    R    K    L  
  R    D    D    A    R     | / / | | / | | \ / | | \ |        K    L    O    R    D 
 A         R         K      | / / | | / | | \ / | | \ |              L    O         R
     D    A         R         /   \ / | | | / | | / \ /     K    L         O    R    
         D    D         A     /   \ / | | | / | | / \/            R    K    L    O   
             R         D    D     / | / \ |   \ /        A    R    K    L    O    R  
       D    A    R    K    L      / | / \ |    \/              O    R    D    D      
 R    K    L    O    R    D       \ /     |      D    A    R         K    L    O    R
          D    A    R             \/      |            K    L    O    R    D    D    

*/
//TEMPLATE V2
	import java.io.*;
	import java.util.*;
	import java.math.*;
	
public class Main {
//Solution goes below: ------------------------------------
	//Modulus. Obviously, set this to what you need.
	final static long MOD=1000000007;

	static long pow(long a, long b){
		//Returns a^b%MOD
		long res = 1;
		a%=MOD;
		b%=(MOD-1);//ETF.
		while(b>0){
			if((b&1)==1){
				res*=a;
				res%=MOD;
			}
			b>>=1;
			a*=a;
			a%=MOD;
		}
		return(res);
	}

	static long[] factorial;
	

	static long inv(long x){
		/*
		Used for division. Note that by ETF, x**(MOD-1)=1, so x**(MOD-2)=1/x.
		*/
		return(pow(x,MOD-2));
	}

	static long nCr(int n, int r){
		if(r<0||r>n){
			return(0);
		}
		//nCr = n!/(r!*(n-r)!).
		return((((factorial[n]*inv(factorial[r]))%MOD)*inv(factorial[n-r]))%MOD);
	}
	static class PT implements Comparable<PT>{
		int x;
		int y;
		PT(int a,int b){
			x=a;y=b;
		}
		public int compareTo(PT b) {
			
			return(((this.x>b.x)?1:(this.x==b.x)?0:-1)+
			((this.y>b.y)?1:(this.y==b.y)?0:-1));
		}
	}
    public static void solution() throws IOException{
		
		int h = nextInt();
		int w = nextInt();
		int n = nextInt();
		final int max = h+w+1;
		factorial = new long[max];
		factorial[0]=1;
		for(int i =1;i<max;i++){
			factorial[i] = (factorial[i-1]*i)%MOD;
		}
		/*for(long i:factorial){
			println(i);
		}*/
		PT[] black = new PT[n+1];
		for(int i =0;i<n;i++){
			black[i]=new PT(nextInt()-1,nextInt()-1);
		}
		black[n] = new PT(h-1,w-1);

		Arrays.sort(black);
		/*for(PT i:black){
			print(i.x);print(" ");
			println(i.y);
		}*/
		long[] dp = new long[n+1];

		for(int i =0;i<n+1;i++){
			dp[i] = nCr(black[i].x+black[i].y,black[i].x);

			for(int j=0;j<i;j++){
				int dx = black[i].x-black[j].x;
				int dy = black[i].y-black[j].y;
				/*println(dx);
				println(dy);
				println(nCr(dx+dy,dx));*/
				dp[i]-=(nCr(dx+dy,dx)*dp[j])%MOD;
				dp[i]+=MOD;
				dp[i]%=MOD;
			}
		}
		/*for(long i:dp){
			println(i);
		}*/
		println(dp[n]);
    }

//Solution goes above: ------------------------------------
	public static final String IN_FILE = "in.txt";
	public static final String OUT_FILE = "";
//-------------------- ------------------------------------
	//IO
	public static BufferedReader br;
	public static StringTokenizer st;
	public static BufferedWriter bw;
    public static void main(String[] args) throws IOException{
		if(IN_FILE==""){
			br = new BufferedReader(new InputStreamReader(System.in)); 
		}else{
			try {
				br = new BufferedReader(new FileReader(IN_FILE));
			} catch (FileNotFoundException e) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
		}
		if (OUT_FILE==""){
			bw = new BufferedWriter(new OutputStreamWriter(System.out));
		}else{
			try {
				bw = new BufferedWriter (new FileWriter(OUT_FILE) );
			} catch (FileNotFoundException e) {
				bw = new BufferedWriter(new OutputStreamWriter(System.out));
			}
		}
		solution();
		bw.close();//Flushes too.
	}

	public static String nextToken() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public static String nextLine() {
		st = null;
		try {
			return br.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public static int nextInt() {
		return Integer.parseInt(nextToken());
	}

	public static long nextLong() {
		return Long.parseLong(nextToken());
	}

	public static double nextDouble() {
		return Double.parseDouble(nextToken());
	}
	
	public static void println(Object s) throws IOException{
		bw.write(s.toString()+"\n");
	}
	
	public static void println() throws IOException{
		bw.newLine();
	}

    public static void print(Object s) throws IOException{
		bw.write(s.toString());
	}
	public static void flush() throws IOException{//Useful for debug
		bw.flush();
	}
	//Other
	public static class Arr<T> extends ArrayList<T> {} //I hate typing ArrayList
}