#include <stdio.h>;
#include <iostream>
#include <math.h>
#include<cstdio>
#include<algorithm>
using namespace ::std;
int n, m;
int p[1010][101000];
int num;
void fun(int x,int y) {
if (x == n && y == n)num=(num+1)%100003;
else if (p[x][y] == 1||x>n||y>n)return ;
else {
fun(x + 1, y);
fun(x, y + 1);
}
}
int main() {
scanf("%d %d", &n, &m);
int x, y;
for (int i = 1; i <= m; i++) {
scanf("%d %d", &x, &y);
p[x][y] = 1;
}
fun(1, 1);
cout << num;
return 0;
}
**