#include<iostream>
#define MAX 100005
using namespace std;
int st[MAX];//st=steps
int n,k;
int main()
{
cin>>n>>k;
for(int i=0;i<MAX;i++)
{
st[i]=0;
}
st[0]=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=k&&(i-j)>=0;j++)
{
st[i]=st[i]+st[i-j];
st[i]=st[i]%100003;
}
}
cout<<st[n];
return 0;
}