// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,b) for (register int i=(a); i<=(b); ++i)

#define per(i,a,b) for (register int i=(a); i>=(b); --i)

using namespace std;

 

inline char getch() {

	static char buf[300000], *p1 = buf, *p2 = buf;

	return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 300000, stdin), p1 == p2) ? EOF : *p1++;

}

inline int read() {

	char ch = getch(); int x = 0;

	while (!isdigit(ch)) ch = getch();

	while (isdigit(ch)) { x = (x<<3) + (x<<1) + ch - '0'; ch = getch(); }

	return x;

}

 

const int maxm = 100005, MOD = 1000000007;

int p[30][3][3], q[3][3], t[3][3], A[3][3];

int x, last = -1, n, m;

 

inline void mul33(int a[3][3], int b[3][3], int c[3][3]) {

	t[0][0] = (1LL * a[0][0] * b[0][0] + 1LL * a[0][1] * b[1][0] + 1LL * a[0][2] * b[2][0]) % MOD;

	t[0][1] = (1LL * a[0][0] * b[0][1] + 1LL * a[0][1] * b[1][1] + 1LL * a[0][2] * b[2][1]) % MOD;

	t[0][2] = (1LL * a[0][0] * b[0][2] + 1LL * a[0][1] * b[1][2] + 1LL * a[0][2] * b[2][2]) % MOD;

	t[1][0] = (1LL * a[1][0] * b[0][0] + 1LL * a[1][1] * b[1][0] + 1LL * a[1][2] * b[2][0]) % MOD;

	t[1][1] = (1LL * a[1][0] * b[0][1] + 1LL * a[1][1] * b[1][1] + 1LL * a[1][2] * b[2][1]) % MOD;

	t[1][2] = (1LL * a[1][0] * b[0][2] + 1LL * a[1][1] * b[1][2] + 1LL * a[1][2] * b[2][2]) % MOD;

	t[2][0] = (1LL * a[2][0] * b[0][0] + 1LL * a[2][1] * b[1][0] + 1LL * a[2][2] * b[2][0]) % MOD;

	t[2][1] = (1LL * a[2][0] * b[0][1] + 1LL * a[2][1] * b[1][1] + 1LL * a[2][2] * b[2][1]) % MOD;

	t[2][2] = (1LL * a[2][0] * b[0][2] + 1LL * a[2][1] * b[1][2] + 1LL * a[2][2] * b[2][2]) % MOD;

	c[0][0] = t[0][0]; c[0][1] = t[0][1]; c[0][2] = t[0][2];

	c[1][0] = t[1][0]; c[1][1] = t[1][1]; c[1][2] = t[1][2];

	c[2][0] = t[2][0]; c[2][1] = t[2][1]; c[2][2] = t[2][2];

}

 

inline void mul31(int a[3][3], int b[3][3], int c[3][3]) {

	t[0][0] = (1LL * a[0][0] * b[0][0] + 1LL * a[0][1] * b[1][0] + 1LL * a[0][2] * b[2][0]) % MOD;

	t[1][0] = (1LL * a[1][0] * b[0][0] + 1LL * a[1][1] * b[1][0] + 1LL * a[1][2] * b[2][0]) % MOD;

	t[2][0] = (1LL * a[2][0] * b[0][0] + 1LL * a[2][1] * b[1][0] + 1LL * a[2][2] * b[2][0]) % MOD;

	c[0][0] = t[0][0]; c[1][0] = t[1][0]; c[2][0] = t[2][0];

}

 

inline void mulPower(int k, int a[3][3]) {

	per (i, 29, 0) if (k>>i&1) mul31(p[i], a, a);

}

 

 

int main() {

	p[0][0][0] = 1; p[0][0][1] = 0; p[0][0][2] = 1;

	p[0][1][0] = 2; p[0][1][1] = 1; p[0][1][2] = 2;

	p[0][2][0] = 1; p[0][2][1] = 1; p[0][2][2] = 2;

	q[0][0] = 1; q[0][1] = 0; q[0][2] = 0;

	q[1][0] = 2; q[1][1] = 1; q[1][2] = 0;

	q[2][0] = 1; q[2][1] = 1; q[2][2] = 1;

	rep (i, 1, 29) mul33(p[i-1], p[i-1], p[i]);

	A[0][0] = 1; n = read(); m = read();

	while (m--) {

		x = read();

		mulPower(x-last-1, A);

		mul31(q, A, A);

		last = x;

	}

	mulPower(n-last-1, A);

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

	return 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: