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 factorial = [1, 1] inverse = [1, 1] invere_base = [0, 1] for i in range(2, H+W + 1): factorial.append((factorial[-1] * i) % MOD) invere_base.append((-invere_base[MOD % i] * (MOD // i)) % MOD) #逆元 inverse.append((inverse[-1] * invere_base[-1]) % MOD) #階乗逆元 #combination def nCr(n, r): if (r < 0 or r > n): return 0 r = min(r, n - r) return factorial[n] * inverse[r] % MOD * inverse[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<