// Slower C++ solution:
#include<map>

#include<set>

#include<stack>

#include<queue>

#include<cmath>

#include<cstring>

#include<climits>

#include<cstdio>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)

//char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;

inline int read() {

	bool f=0;int x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c==EOF)exit(0);if(c=='-')f=1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return !f?x:-x;

}

#define MAXN 100000

#define INF 0x3f3f3f3f

#define Mod (int)(1e9+7)

struct Matrix{

	#define MAXC 4

	int r,c;

	LL m[MAXC+5][MAXC+5];

	void Init(int R,int C){

		r=R,c=C;

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

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

				m[i][j]=0;

		return ;

	}

	friend Matrix operator * (Matrix A,Matrix B){

		Matrix C;C.Init(A.r,B.c);

		for(int i=0;i<A.r;i++)

			for(int j=0;j<B.c;j++)

				for(int k=0;k<A.c;k++)

					C.m[i][j]=(C.m[i][j]+A.m[i][k]*B.m[k][j])%Mod;

		return C;

	}

	void Print(){

		puts("");

		for(int i=0;i<r;i++,puts(""))

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

				printf("%lld ",m[i][j]);

		puts("");

		return ;

	}

};

Matrix Pow(Matrix x,int y){

	Matrix ret;ret.Init(x.r,x.c);

	for(int i=0;i<ret.r;i++)

		ret.m[i][i]=1;

	while(y){

		if(y&1) ret=ret*x;

		x=x*x,y>>=1;

	}

	return ret;

}

Matrix A,B,C;

void Init(){

	A.Init(1,3),A.m[0][0]=1,A.m[0][1]=2,A.m[0][2]=1;

	B.Init(3,3);

	B.m[0][0]=1,B.m[0][1]=2,B.m[0][2]=1,

	B.m[1][0]=0,B.m[1][1]=1,B.m[1][2]=1,

	B.m[2][0]=1,B.m[2][1]=2,B.m[2][2]=2;

	C.Init(3,3);

	C.m[0][0]=1,C.m[0][1]=2,C.m[0][2]=1,

	C.m[1][0]=0,C.m[1][1]=1,C.m[1][2]=1,

	C.m[2][0]=0,C.m[2][1]=0,C.m[2][2]=1;

	return ;

}

int main(){

	int n=read(),m=read();

	Init();

	int lst=1;

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

		int x=read();

		A=A*Pow(B,x-lst);

		A=A*C;

		lst=x+1;

	}

	A=A*Pow(B,n-lst);

	printf("%lld\n",A.m[0][2]);

	return 0;

}

//

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

#include <assert.h>



typedef long long LL;



const int MAXM = 1e5, MOD = 1e9 + 7;

int n, m;



inline int add ( int a, const int b ) { return ( a += b ) < MOD ? a : a - MOD; }

inline int mul ( LL a, const int b ) { return ( a *= b ) < MOD ? a : a % MOD; }



inline int rint () {

	int x = 0; char s = getchar ();

	for ( ; s < '0' || '9' < s; s = getchar () );

	for ( ; '0' <= s && s <= '9'; s = getchar () ) x = x * 10 + ( s ^ '0' );

	return x;

}



struct Matrix {

	int n, m, mat[3][3];

	Matrix (): n ( 0 ), m ( 0 ), mat {} {}

	Matrix ( const int tn, const int tm ): n ( tn ), m ( tm ), mat {} {}

	inline int* operator [] ( const int key ) { return mat[key]; }

	inline Matrix operator * ( Matrix t ) {

		assert ( m == t.n );

		Matrix ret ( n, t.m );

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

			for ( int k = 0; k < m; ++ k ) {

				for ( int j = 0; j < t.m; ++ j ) {

					ret[i][j] = add ( ret[i][j], mul ( mat[i][k], t[k][j] ) );

				}

			}

		}

		return ret;

	}

};



inline Matrix qkpow ( Matrix a, int b ) {

	Matrix ret ( a.n, a.m );

	for ( int i = 0; i < ret.n; ++ i ) ret[i][i] = 1;

	for ( ; b; a = a * a, b >>= 1 ) if ( b & 1 ) ret = ret * a;

	return ret;

}



Matrix I ( 3, 1 ), A ( 3, 3 ), B ( 3, 3 );



inline void init () {

	I[0][0] = 1;

	A[0][0] = 1;

	A[1][0] = 2, A[1][1] = 1;

	A[2][0] = A[2][1] = A[2][2] = 1;

	B = A, ++ B[0][0], ++ B[0][1], ++ B[0][2];

}



int main () {

	init ();

	n = rint (), m = rint ();

	int las = 0;

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

		x = rint ();

		I = A * qkpow ( B, x - las - 1 ) * I;

		las = x;

	}

	

	I = A * qkpow ( B, n - las - 1 ) * I;

	printf ( "%d\n", I[2][0] );

	return 0;

}