#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i32 = int32_t;
using i64 = int64_t;
constexpr char newl = '\n';

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
//#define F first
//#define S second
#define debug(x) cout << #x << ": " << x << '\n';
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1

constexpr int MOD = 1e9 + 7; // 1e9 + 7

struct Factorial {

  int modpow(int& a, u64 n) noexcept {
    if (n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = (int)((i64)t * t % mod);
    if (n & 1) t = (int)((i64)t * a % mod);
    return t;
  }

  Factorial(int count, int mod) : mod(mod) {

    f.reserve(count + 1);
    fi.reserve(count + 1);

    f.push_back(1);
    fi.push_back(1);
    FOR(i, 1, count + 1) {
      f.push_back((int)(((i64)f[i - 1] * i) % mod));
      fi.push_back(modpow(f[i], mod - 2));
      //cout << i << " " << f[i] << " " << fi[i] << newl;
    }
    f[0] = 0;
  }

  int Ncr(int n, int r) {
    //debug(f[n]);
    //debug(fi[r]);
    //debug(fi[n - r]);
    return (int)((i64)f[n] * fi[r] % mod * fi[n - r] % mod);
  }

  // 自分では何が起きているか分かっていないmod除算
  // - mod が素数じゃないと動かない模様
  // - 4 / 2 を mod100 で計算したら 4 になった
  int Div(int l, int r) noexcept {
    long long a = r, b = mod, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b; swap(a, b);
      u -= t * v; swap(u, v);
    }
    l = l * u % mod;
    if (l < 0) l += mod;
    return l;
  }
  // こちらも mod が素数じゃないと動かない様子
  // - 4 / 2 を mod100 で計算したら 76 になった
  /*
  int Div(int l, int r) noexcept {
    return l * modpow(r, mod - 2) % mod;
  }
  */

  int mod;

  // 階乗
  vector<int> f;

  // 階乗の逆元
  vector<int> fi;
};

template<int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v% MOD) {
    if (val < 0) val += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator - () const noexcept {
    return val ? MOD - val : 0;
  }
  constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp& operator += (const Fp& r) noexcept {
    val += r.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  constexpr Fp& operator -= (const Fp& r) noexcept {
    val -= r.val;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr Fp& operator *= (const Fp& r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp& operator /= (const Fp& r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b; swap(a, b);
      u -= t * v; swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0) val += MOD;
    return *this;
  }
  constexpr bool operator == (const Fp& r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator != (const Fp& r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream& operator << (ostream& os, const Fp<MOD>& x) noexcept {
    return os << x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD>& a, long long n) noexcept {
    if (n == 0) return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1) t = t * a;
    return t;
  }
};

Factorial fc(200001, MOD);

// [0, 0] から [r, c] に行く経路の数を求める
int gp(int r, int c) {
  // 1  1  1  1  1
  // 1  2  3  4  5
  // 1  3  6 10 15
  // 1  4 10 20 35
  // 1  5 15 35 70

  // ↓ r個と → c個を並べる場合の数だから r+cCr

  return fc.Ncr(r + c, r);
}

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int H, W, N;
  cin >> H >> W >> N;

  struct RC {
    int r, c;
    RC(int r = 0, int c = 0) : r(r), c(c) {}
  };

  vector<RC> vs(N + 1);
  F0R(i, N) {
    cin >> vs[i].r >> vs[i].c;
  }
  vs.back().r = H;
  vs.back().c = W;

  sort(vs.begin(), vs.end(), [](const RC& l, const RC& r)->bool {
    return l.r + l.c < r.r + r.c;
    });

  vector<Fp<MOD>> dp(N + 1);

  F0R(i, N + 1) {

    dp[i] = gp(vs[i].r - 1, vs[i].c - 1);

    F0R(j, i) {
      if (vs[i].r >= vs[j].r && vs[i].c >= vs[j].c) {
        dp[i] -= dp[j] * gp(vs[i].r - vs[j].r, vs[i].c - vs[j].c);
        //debug(dp[j]);
      }
    }
  }
  //Print(dp);

  cout << dp.back().val;
}
#endif


Measured memory_bytes: 1920