#include #include #include #include #include using namespace std; const int MOD = 1000003; int main() { int x, n; cin >> x >> n; vector a(n); int maxi = 0; for (int i = 0; i < n; i++) { cin >> a[i]; maxi = max(maxi, a[i]); } vector memo(maxi); memo[0] = 1; for (int i = 1; i <= maxi; i++) { memo[i] = (memo[i - 1] * x) % MOD; } int ans = 0; for (int i = 0; i < n; i++) { ans = (ans + memo[a[i]]) % MOD; } cout << ans << endl; return 0; }