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

using namespace std;



const int N = 100000 + 10;

const int Mod = 1e9 + 7;

const int D = 3;



struct Vector {

	int a[D];

	int &operator[]( int i ) { return a[i]; }

	const int &operator[]( int i ) const { return a[i]; }

};

struct Matrix {

	int a[D][D];

	void zero(){

		memset( a, 0, sizeof(a) );

	}

	void unit(){

		memset( a, 0, sizeof(a) );

		for( int i = 0; i < D; i++ ) a[i][i] = 1;

	}

	int * operator[]( int i ) { return a[i]; }

	const int * operator[]( int i ) const { return a[i]; }

};

Matrix operator*( const Matrix &r, const Matrix &s ) {

	Matrix rt;

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

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

			rt[i][j] = 0;

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

				rt[i][j] = int((rt[i][j] + 1LL * r[i][k] * s[k][j]) % Mod);

		}

	return rt;

}

Vector operator*( const Matrix &r, const Vector &s ) {

	Vector rt;

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

		rt[i] = 0;

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

			rt[i] = int((rt[i] + 1LL * r[i][k] * s[k]) % Mod);

	}

	return rt;

}



int n, m;

int sep[N];

long long f[N];



Matrix mpow( Matrix a, int b ) {

	Matrix rt;

	for( rt.unit(); b; b>>=1,a=a*a )

		if( b & 1 ) rt = rt * a;

	return rt;

}



int main() {

	Matrix T1, T2;

	T1.zero(), T2.zero();

	T1[0][0] = T1[0][1] = T1[2][1] = 2;

	T1[0][2] = T1[1][0] = T1[1][1] = T1[2][0] = T1[2][2] = 1;

	T2[0][0] = T2[1][0] = T2[1][1] = T2[2][0] = T2[2][2] = 1;

	T2[2][1] = 2;

	Vector cur;

	cur[0] = 1;

	cur[1] = cur[2] = 0;



	scanf( "%d%d", &n, &m );

	for( int i = 1; i <= m; i++ )  {

		scanf( "%d", sep + i );

	}

	int last = 0;

	for( int i = 1; i <= m; i++ ) {

		cur = mpow(T1,sep[i] - last - 1) * cur;

		cur = T2 * cur;

		last = sep[i];

	}

	cur = mpow(T1,n - last - 1) * cur;

	int ans = int((0LL + cur[0] + cur[1] * 2 + cur[2]) % Mod);

	printf( "%d\n", ans );

}








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

#include<cstring>

#include<algorithm>

#define MAXM 100000

#define MO 1000000007

using namespace std;

struct Matrix

{

	int M[4][4];

	Matrix operator * (const Matrix &b)

	{

		Matrix ret;

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

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

			{

				ret.M[i][j]=0;

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

					ret.M[i][j]=(1LL*ret.M[i][j]+1LL*M[i][k]*b.M[k][j]%MO)%MO;

			}

		return ret;

	}

};

int x[MAXM+5],N,M;

int finans[4],d[4];

Matrix PowMod(Matrix a,int b)

{

	Matrix ret;

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

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

		{

			if(i==j)

				ret.M[i][j]=1;

			else

				ret.M[i][j]=0;

		}

	while(b)

	{

		if(b&1)

			ret=ret*a;

		a=a*a;

		b>>=1;

	}

	return ret;

}

int main()

{

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

	for(int i=1;i<=M;i++)

		scanf("%d",&x[i]),x[i]++;

	sort(x+1,x+1+M);

	Matrix ans,usu,ususpe;

	//===========================================

	usu.M[1][1]=1,usu.M[1][2]=0,usu.M[1][3]=0;

	usu.M[2][1]=1,usu.M[2][2]=1,usu.M[2][3]=0;

	usu.M[3][1]=1,usu.M[3][2]=2,usu.M[3][3]=1;

	//===========================================

	ususpe.M[1][1]=1,ususpe.M[1][2]=0,ususpe.M[1][3]=1;

	ususpe.M[2][1]=1,ususpe.M[2][2]=1,ususpe.M[2][3]=1;

	ususpe.M[3][1]=1,ususpe.M[3][2]=2,ususpe.M[3][3]=2;

	//===========================================

	d[1]=d[2]=d[3]=1;

	int pre=1;

	for(int i=1;i<=M;i++)

	{

		ans=PowMod(ususpe,x[i]-pre-1);

		memset(finans,0,sizeof(finans));

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

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

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		ans=usu;

		memset(finans,0,sizeof(finans));

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

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

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		pre=x[i];

	}

	ans=PowMod(ususpe,N-pre);

	memset(finans,0,sizeof(finans));

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

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

			finans[i]=(1LL*finans[i]+1LL*ans.M[i][j]*d[j]%MO)%MO;

	printf("%d\n",finans[3]);

	return 0;

}