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

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

 

using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



const int MOD=1e9+7;

const int DIM = 4;



struct Matrix {

  int a[DIM][DIM];

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



  Matrix(int x = 0) {

    memset(a, 0, sizeof a);

    if (x)

    {

		for(int i = 0; i < DIM; i++) a[i][i] = x;

	}

  }

} const I(1);



Matrix operator * (Matrix A, Matrix B) {

  const ll mod2 = ll(MOD) * MOD;

  Matrix C;

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

 {

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

	 {

		ll w = 0;

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

		{

			w += ll(A[i][k]) * B[k][j];

			if (w >= mod2) w -= mod2;

		}

	C[i][j] = w % MOD;

	}

  }

  return C;

}



Matrix operator ^ (Matrix A, ll b) {

  Matrix R = I;

  for (; b > 0; b /= 2) {

    if (b % 2) R = R*A;

    A = A*A;

  }

  return R;

}



void add(ll &a, ll b)

{

	a+=b;

	while(a>=MOD) a-=MOD;

}



ll mult(ll a, ll b)

{

	return (a*b)%MOD;

}



Matrix M1,M2;



vector<ll> mult(Matrix &a, vector<ll> cur)

{

	vector<ll> V(4,0);

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

	{

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

		{

			add(V[i], mult(a[i][j],cur[j]));

		}

	}

	return V;

}



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	ll n,k;

	cin>>n>>k;

	vi vec;

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

	{

		ll x; cin>>x; vec.pb(x);

	}

	vec.pb(n);

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

	{

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

		{

			if((j&i)==j)

			{

				M1[i][j]=M2[i][j]=1;

			}

		}

		M1[i][3]++;

	}

	vector<ll> V = {1,1,1,1};

	int cur = 1;

	for(int i = 0; i < vec.size(); i++)

	{

		int ext = vec[i] - cur;

		Matrix M = M1^ext;

		V = mult(M, V);

		cur = vec[i];

		if(cur==n) break;

		cur++;

		V = mult(M2,V);

	}

	cout<<V[3]<<'\n';

}


// Faster C++ solution for the same problem (measured speedup: 5.284873932625321x):
#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;

}