#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

template<unsigned int mod_>
struct ModInt{
	using uint = unsigned int;
	using ll = long long;
	using ull = unsigned long long;

	constexpr static uint mod = mod_;

	uint v;
	ModInt():v(0){}
	ModInt(ll v):v(normS(v%mod+mod)){}
	explicit operator bool() const {return v!=0;}
	static uint normS(const uint &x){return (x<mod)?x:x-mod;}		// [0 , 2*mod-1] -> [0 , mod-1]
	static ModInt make(const uint &x){ModInt m; m.v=x; return m;}
	ModInt operator+(const ModInt& b) const { return make(normS(v+b.v));}
	ModInt operator-(const ModInt& b) const { return make(normS(v+mod-b.v));}
	ModInt operator-() const { return make(normS(mod-v)); }
	ModInt operator*(const ModInt& b) const { return make((ull)v*b.v%mod);}
	ModInt operator/(const ModInt& b) const { return *this*b.inv();}
	ModInt& operator+=(const ModInt& b){ return *this=*this+b;}
	ModInt& operator-=(const ModInt& b){ return *this=*this-b;}
	ModInt& operator*=(const ModInt& b){ return *this=*this*b;}
	ModInt& operator/=(const ModInt& b){ return *this=*this/b;}
	ll extgcd(ll a,ll b,ll &x,ll &y) const{
		ll u[]={a,1,0},v[]={b,0,1};
		while(*v){
			ll t=*u/ *v;
			rep(i,3) swap(u[i]-=t*v[i],v[i]);
		}
		if(u[0]<0) rep(i,3) u[i]=-u[i];
		x=u[1],y=u[2];
		return u[0];
	}
	ModInt inv() const{
		ll x,y;
		extgcd(v,mod,x,y);
		return make(normS(x+mod));
	}
	bool operator==(const ModInt& b) const { return v==b.v;}
	bool operator!=(const ModInt& b) const { return v!=b.v;}
	friend istream& operator>>(istream &o,ModInt& x){
		ll tmp;
		o>>tmp;
		x=ModInt(tmp);
		return o;
	}
	friend ostream& operator<<(ostream &o,const ModInt& x){ return o<<x.v;}
};
using mint = ModInt<1000000007>;

const mint zero(0),one(1);
bool iszero(mint x){
	return x.v==0;
}

template<class T>
struct Matrix{
	int H,W;
	vector< vector<T> > m;
	Matrix():H(0),W(0){}
	Matrix(int H,int W):H(H),W(W),m( vector< vector<T> >(H,vector<T>(W,zero)) ){}
	//↓0*W行列を渡すと壊れるので危険←そんなの渡さないでしょ・・・
	//Matrix(vector< vector<T> > m):m(m),H(m.size()),W(m[0].size()){}
	vector<T> const& operator[](const int& i) const {return m[i];}
	vector<T>& operator[](const int& i) {return m[i];}
	Matrix operator+=(const Matrix& b){
		//assert(H==b.H&&W==b.W);
		rep(i,H) rep(j,H) m[i][j]+=b[i][j];
		return *this;
	}
	Matrix operator-=(const Matrix& b){
		//assert(H==b.H&&W==b.W);
		rep(i,H) rep(j,H) m[i][j]-=b[i][j];
		return *this;
	}
	Matrix operator+(const Matrix& b){return Matrix(*this)+=b;}
	Matrix operator-(const Matrix& b){return Matrix(*this)-=b;}
	Matrix operator*(const Matrix& b){
		//assert(W==b.H);
		Matrix c(H,b.W);
		rep(i,H) rep(j,W) rep(k,b.W) c[i][j]+=m[i][k]*b[k][j];
		return c;
	}
	Matrix operator*=(const Matrix& b){return (*this)=(*this)*b;}
	vector<T> operator*(const vector<T>& b){
		//assert(W==b.size());
		vector<T> c(H);
		rep(i,H) rep(j,W) c[i]+=m[i][j]*b[j];
		return c;
	}
	static Matrix E(int N){
		Matrix a(N,N);
		rep(i,N) a[i][i]=one;
		return a;
	}
	Matrix ex(int t) {
//		//assert(H==W);
		Matrix x=Matrix::E(H),b=(*this);
		while(t){
			if(t%2) x*=b;
			b*=b;
			t/=2;
		}
		return x;
	}
	int sweep(int var=-1){			//return rank 副作用		swap!!!
		if(var<0) var=W;
		int r=0;
		rep(i,var){
			if(iszero(m[i][i])){
				for(int j=i+1;j<H;j++) if(!iszero(m[j][i])){
					for(int k=i;k<W;k++) swap(m[i][k],m[j][k]);
					break;
				}
				if(iszero(m[i][i])) continue;
			}
			r++;
			T t=m[i][i];
			rep(k,W) m[i][k]/=t;
			rep(k,H) if(k!=i){
				t=m[k][i];
				rep(l,W) m[k][l]=m[k][l]-m[i][l]*t;
			}
//			show((*this));
		}
		return r;
	}
	Matrix inv(){
		//assert(H==W);
		Matrix a(H,2*H);
		rep(i,H) rep(j,H) a[i][j]=m[i][j];
		rep(i,H) a[i][i+H]=one;
		int r=a.sweep(H);
		if(r<H) return Matrix();
		Matrix b(H,H);
		rep(i,H){
			rep(j,H) b[i][j]=a[i][j+H];
		}
		return b;
	}
	pair< int,vector<T> > sle(vector<T> b){		// return pair( 解の次元(もし空集合なら-1) ,x s.t.Ax=b)
		//assert(H==b.size());
		Matrix a(H,W+1);
		rep(i,H) rep(j,W) a[i][j]=m[i][j];
		rep(i,H) a[i][W]=b[i];
		a.sweep(W);
		int d=0;
		rep(i,H){
			bool all0=1;
			rep(j,W) if(!iszero(a[i][j])) all0=0;
			if(all0){
				if(!iszero(a[i][W])){
					return pair<int,vector<T> >(-1,vector<T>());
				}
				d++;
			}
		}
		rep(i,H) b[i]=a[i][W];
		return pair<int,vector<T> >(d,b);
	}
	friend ostream& operator<<(ostream &o,const Matrix& m){
		o<<m.H<<" * "<<m.W<<endl;
		rep(i,m.H){
			o<<"[";
			rep(j,m.W) o<<m[i][j]<<" ";
			o<<"]"<<endl;
		}
		return o;
	}
};


int L,N;
const int MN=100010;
mint dp[MN];
int X[MN];
Matrix<mint> sum;
Matrix<mint> A,Ainv;

Matrix<mint> Ae[30],Aie[30];

Matrix<mint> Aex(int p){
	Matrix<mint> ret = Matrix<mint>::E(3);
	rep(i,30) if((p>>i)&1) ret*=Ae[i];
	return ret;
}
Matrix<mint> Aiex(int p){
	Matrix<mint> ret = Matrix<mint>::E(3);
	rep(i,30) if((p>>i)&1) ret*=Aie[i];
	return ret;
}

int main(){
	// int len = 20;
	// mint dp[len+1]={};
	// dp[0]=1;
	// rep1(r,len){
	// 	rep(l,r){
	// 		dp[r]+=dp[l]*(r-l)*(r-l);
	// 	}
	// }
	// dp[0]=0;
	// rep(i,10) cout<<dp[i+3]-dp[i]+dp[i+1]*2-dp[i+2]*4<<endl;
	// rep(i,20) cout<<"dp["<<i<<"]="<<dp[i]<<endl;

	A = Matrix<mint>(3,3);
	A.m[0][0]=4;
	A.m[0][1]=-2;
	A.m[0][2]=1;
	A.m[1][0]=1;
	A.m[2][1]=1;
	Ainv = A.inv();

	Ae[0] = A;
	Aie[0] = Ainv;

	rep(i,29){
		Ae[i+1] = Ae[i] * Ae[i];
		Aie[i+1] = Aie[i] * Aie[i];
	}

	// show(A);
	// show(Ainv);

	
	cin>>L>>N;
	// L=1e9;
	// N=1e5;

	dp[0]=1;

	sum = Matrix<mint>::E(3);
	rep(i,N) cin>>X[i+1];
//	rep(i,N) X[i+1] = (i+1)*100;
	X[0]=0,X[N+1]=L;

	rep1(i,N+1){
		int r = X[i];
		Matrix<mint> tmp = sum * Aex(r);
		dp[i] = - (tmp.m[2][0]*5 + tmp.m[2][1]);

		tmp = Aiex(r);
		rep(x,3) rep(y,3) tmp.m[x][y] *= dp[i];
		sum += tmp;
	}
	mint ans = -dp[N+1];
	cout<<ans<<endl;
}


Measured memory_bytes: 1024