#include int M = 1000003; using namespace std; int powModM(long int x,long int a){ if(a == 0) return 1; else if(a%2 == 0) return (powModM(x,a/2) * powModM(x,a/2)) % M; else (powModM(x,a-1) * (x % M)) % M; } int main(){ long long int sum = 0; long long int ans; int x,N; cin >> x >> N; int a; for(int i=0;i> a; sum += powModM(x,a); } ans = sum % M; return ans; }