#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 1000000 #define MOD 1000000009 //#define MOD 998244353 //#define INF 1000000000 #define INF 1000000000000000000 ll modpow(ll a,ll n,ll mod){ ll res=1; while(n>0){ if(n&1){ res=(res*a)%mod; } a=(a*a)%mod; n>>=1; } return res; } ll modinv(ll a,ll mod){ return modpow(a,mod-2,mod); } int main(){ ll x; int N; const ll P=1000003; cin>>x>>N; vector a(N); for(int i=0;i>a[i]; } ll ans=0; for(int i=0;i