// 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.108555187467804x):
#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;

}