H,W,K = map(int,input().split()) L = [list(map(int,input().split())) for _ in range(K)] L = [L[i][0]*(W+1)+L[i][1] for i in range(K)] MOD = 10**8+7 mod = MOD fac = [1] for i in range(1,H+W+1): fac.append((fac[-1]*i) % mod) fac_inv = [0]*(H+W+1) f = pow(fac[-1],mod-2,mod) for i in range(H+W,-1,-1): fac_inv[i] = f f *= i f %= mod def nCr(n,r): if r < 0: return 0 return fac[n] * fac_inv[r] % mod * fac_inv[n-r] % mod def bit_count(n): c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555) c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333) c = (c & 0x0f0f0f0f0f0f0f0f) + ((c >> 4) & 0x0f0f0f0f0f0f0f0f) c = (c & 0x00ff00ff00ff00ff) + ((c >> 8) & 0x00ff00ff00ff00ff) c = (c & 0x0000ffff0000ffff) + ((c >> 16) & 0x0000ffff0000ffff) c = (c & 0x00000000ffffffff) + ((c >> 32) & 0x00000000ffffffff) return c D = [0]*(1<