def comb(r, n): ret = 1 p = 1 for i in range(r,r-n,-1): ret *= i for i in range(1,n + 1): p *= i ret //= p return ret def main(): ## Gather datas H,W,K = list(map(int, input().split())) P = [list(map(int, input().split())) for _ in range(K)] ## Calcuation # Constants A = comb((H+W),H) K2 = pow(K,2) DV = pow(10,8)+7 #Loop for i in range(K2): R = A pp = [0 for _ in range(2)] #print("Q." + str(i)) for j in range(K): if i & ( j + 1) != 0: SF= comb(P[j][0] + P[j][1], P[j][0]) FG= comb((H - P[j][0]) + (W - P[j][1]), (H - P[j][0])) R -= SF * FG pp = P[j] print(R % DV) if __name__ == "__main__": main()