#include<stdio.h>
#include<stdbool.h>
#include<string.h>
#define mod 100003
_Bool mark[2000][2000];
int count[2000][2000];
int main()
{
memset(mark,true,sizeof(mark));
int N,M;
int x,y;
int i,j;
scanf("%d%d",&N,&M);
while(M--)
{
scanf("%d %d",&x,&y);
mark[x][y]=false;
}
for(i=1;i<=1000;i++)
for(j=1;j<=1000;j++)
{
if(mark[i][j]==false)
continue;
if((i==1||j==1))
count[i][j]=1;
else
count[i][j]=(count[i-1][j]%mod+count[i][j-1]%mod)%mod;
}
printf("%lld",count[N][N]);
}