#include using namespace std; const int M=1000003; long long pw[40]={1}; long long x,n,a,ans; long long pw_md(long long p){ long long res=1,cnt=0; while(p){ if(p%2){ res*=pw[cnt+1]; res%=M; } ++cnt; p/=2; } return res; } int main(){ cin>>x>>n; pw[1]=x; for(int i=2;i<40;++i) pw[i]=pw[i-1]*pw[i-1]%M; for(int i=0;i>a; ans+=pw_md(a); ans%=M; } cout<