
import std.stdio;

bool include(int[][] pos, int i, int j) {
  bool ans = false;
  foreach(p; pos) {
    if (p == [i, j]) {ans = true; break;}
  }
  return ans;
}

void main() {
  int width, height;
  while(readf("%d %d\n", &width, &height), (width + height) != 0) {
    int[][] pos;
    int number;
    readf("%d\n", &number);
    for(int i, j, n = 0; n < number; n++) {
      readf("%d %d\n", &i, &j);
      pos ~= [i - 1, j -  1];
    }

    int[][] route = new int[][](width, height);;

    for(int i = 0; i < width; i++)
      route[i][0] = 1;
    for(int j = 0; j < height; j++)
      route[0][j] = 1;
  
    for(int i = 1; i < width; i++) {
      for(int j = 1; j < height; j++) {
        bool a = include(pos, i - 1, j);
        bool b = include(pos, i, j - 1);
        if (a && b) route[i][j] = 0;
        else if (a && !b) route[i][j] = route[i][j - 1];
        else if (!a && b) route[i][j] = route[i - 1][j];
        else {
          route[i][j] = route[i - 1][j] + route[i][j - 1];
        }
      }
    }
    writeln(route[width - 1][height - 1]);
  }
}