#include #include #include #include #define ll long long #define MOD 1000003 using namespace std; ll POW(ll b,ll e){ if(e==0) return 1; if(e%2) return (b*POW(b,e-1))%MOD; else{ ll r=POW(b,e/2)%MOD; return (r*r)%MOD; } } int main(){ ll x,n,a; cin>>x>>n; ll ans=0; for(int i=0;i>a; ans+=POW(x,a); ans%=MOD; } cout<