#include <iostream>
using namespace std;
const int N = 1005;
int n, m;
int fx, fy;
int x1[2] = {0, 1};
int y11[2] = {1, 0};
bool b[N][N];
int ans;
void dfs(int x, int y) {
b[x][y] = 1;
if (x == n && y == n) {
ans++;
b[x][y] = 0;
return ;
} else {
for (int i = 0; i < 2; i++) {
int xx = x + x1[i];
int yy = y + y11[i];
if (xx >= 1 && yy >= 1 && xx <= n && yy <= n && b[xx][yy] == 0) {
dfs(xx, yy);
b[x][y] = 0;
}
}
}
}
int main() {
cin >> n >> m;
for (int i = 1; i <= m; i++) {
cin >> fx >> fy;
b[fx][fy] = 1;
}
dfs(1, 1);
cout << ans % 100003;
return 0;
}