// Original C++ solution (slower):
#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]);

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem: