#include"bits/stdc++.h" //#include using namespace std; #define print(x) cout<> x >> n; rep(i, 0, n) { cin >> a[i]; ans += powmod(x, a[i])%mod; } ans %= mod; print(ans); return 0; }