// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define ll long long

#define MOD 1000000007

#define rint register int

inline int rf(){int r;int s=0,c;for(;!isdigit(c=getchar());s=c);for(r=c^48;isdigit(c=getchar());(r*=10)+=c^48);return s^45?r:-r;}

struct Mat{int c[3][3];}A[32], B, I, U, F; int X[100005], n, m;

inline Mat& operator *= (Mat &A, Mat B)

{

	ll c[3][3] = {{(ll)A.c[0][0]*B.c[0][0]+(ll)A.c[0][1]*B.c[1][0]+(ll)A.c[0][2]*B.c[2][0],

				   (ll)A.c[0][0]*B.c[0][1]+(ll)A.c[0][1]*B.c[1][1]+(ll)A.c[0][2]*B.c[2][1],

				   (ll)A.c[0][0]*B.c[0][2]+(ll)A.c[0][1]*B.c[1][2]+(ll)A.c[0][2]*B.c[2][2]},

				  {(ll)A.c[1][0]*B.c[0][0]+(ll)A.c[1][1]*B.c[1][0]+(ll)A.c[1][2]*B.c[2][0],

				   (ll)A.c[1][0]*B.c[0][1]+(ll)A.c[1][1]*B.c[1][1]+(ll)A.c[1][2]*B.c[2][1],

				   (ll)A.c[1][0]*B.c[0][2]+(ll)A.c[1][1]*B.c[1][2]+(ll)A.c[1][2]*B.c[2][2]},

				  {(ll)A.c[2][0]*B.c[0][0]+(ll)A.c[2][1]*B.c[1][0]+(ll)A.c[2][2]*B.c[2][0],

				   (ll)A.c[2][0]*B.c[0][1]+(ll)A.c[2][1]*B.c[1][1]+(ll)A.c[2][2]*B.c[2][1],

				   (ll)A.c[2][0]*B.c[0][2]+(ll)A.c[2][1]*B.c[1][2]+(ll)A.c[2][2]*B.c[2][2]}};

	A.c[0][0] = c[0][0]%MOD; A.c[0][1] = c[0][1]%MOD; A.c[0][2] = c[0][2]%MOD;

	A.c[1][0] = c[1][0]%MOD; A.c[1][1] = c[1][1]%MOD; A.c[1][2] = c[1][2]%MOD;

	A.c[2][0] = c[2][0]%MOD; A.c[2][1] = c[2][1]%MOD; A.c[2][2] = c[2][2]%MOD; return A;

}	inline Mat fxp(int n){Mat A(I);for(rint i=0;n;n&1?A*=::A[i],0:0,i++,n>>=1);return A;}

int main()

{

	A->c[0][0] = 1; A->c[0][2] = 1; A->c[1][0] = 2; A->c[1][1] = 1; A->c[1][2] = 2; A->c[2][0] = 1; A->c[2][1] = 1; A->c[2][2] = 2;

	B.c[0][0] = 1; B.c[1][0] = 2; B.c[1][1] = 1; B.c[2][0] = 1; B.c[2][1] = 1; B.c[2][2] = 1; I.c[0][0] = I.c[1][1] = I.c[2][2] = 1;

	for(rint i = 1; i < 32; A[i] = A[i-1], A[i] *= A[i-1], i++); n = rf(); m = rf(); generate(X+1,X+m+1,rf); X[++m] = n; U = I;

	for(rint i = m; i; i<m?U*=B,0:0, U *= fxp(X[i]-X[i-1]-1), i--); F.c[0][0] = 1; F.c[1][0] = 2; F.c[2][0] = 1; U *= F; return !printf("%d\n",U.c[2][0]);

}

// Faster C++ solution for the same problem (measured speedup: 4.933409464305554x):
#include <cstdio>



const int MOD=1000000007;



int sr;

int sum(int a, int b){

	sr=a+b;

	if(sr>=MOD)	sr-=MOD;

	return sr;

}



int mul(int a, int b){

	return (int)((1LL*a*b)%(long long)(MOD));

}



int N, M;



int Tr1_[3][3]={{2, 1, 1}, {2, 1, 2}, {1, 0, 1}};

int Tr2_[3][3]={{1, 1, 1}, {0, 1, 2}, {0, 0, 1}};



struct Mat{

	int x[3][3];

} Zero, One, Tr1, Tr2, Ans;



Mat operator * (const Mat &A, const Mat &B){

	Mat ret=Zero;

	for(int i=0;i<3;++i)

		for(int j=0;j<3;++j)

			for(int k=0;k<3;++k)

				ret.x[i][k]=sum(ret.x[i][k], mul(A.x[i][j], B.x[j][k]));

	return ret;

}



Mat operator ^ (const Mat &A, int k){

	Mat ret=One, t=A;

	while(k){

		if(k&1)	ret=ret*t;

		t=t*t;

		k>>=1;

	}

	return ret;

}



int main(){

	

	for(int i=0;i<3;++i){

		One.x[i][i]=1;

		for(int j=0;j<3;++j){

			Tr1.x[i][j]=Tr1_[i][j];

			Tr2.x[i][j]=Tr2_[i][j];

		}

	}

	

	scanf("%d%d", &N, &M);

	Ans=One;

	int p=0;

	for(int i=1, a;i<=M;++i){

		scanf("%d", &a);

		Ans=Ans*(Tr1^(a-p-1));

		Ans=Ans*Tr2;

		p=a;

	}

	Ans=Ans*(Tr1^(N-p));

	printf("%d\n", Ans.x[0][2]);

	

	return 0;

}