// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include<complex>

using namespace std;



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

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



const int MAX = 1000 * 100 + 47;

const int MOD = 1000 * 1000 * 1000 + 7;



struct Matrix

{

	LL A[3][3];

	void one()

	{

		FILL(A, 0);

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

	}



	Matrix operator *(const Matrix& T)

	{

		Matrix res;

		FOR(i, 0, 3)

		{

			FOR(j, 0, 3)

			{

				res.A[i][j] = 0;

				FOR(k, 0, 3)

				{

					res.A[i][j] = (res.A[i][j] + A[i][k] * T.A[k][j]) % MOD;

				}

			}

		}



		return res;

	}



	void print()

	{

		FOR(i, 0, 3)

		{

			FOR(j, 0, 3) cout << A[i][j] << " ";

			cout << endl;

		}

	}

};



//static VI operator *(const VI& V, const Matrix& M)

//{

//	VI R(SZ(V), 0);

//	FOR(i, 0, 3)

//	{

//		FOR(k, 0, 3)

//		{

//			R[i] = (R[i] + V[i] * M.A[k][i]) % MOD;

//		}

//	}

//

//	return R;

//}



Matrix bp(Matrix A, int n)

{

	Matrix R;

	R.one();

	while (n)

	{

		if (n & 1) R = R * A;

		

		n >>= 1;

		A = A * A;

	}



	return R;

}



int X[MAX];

Matrix A, B;

int A1[][3]{ {2, 2, 1}, {1, 1, 1}, {1, 0, 1} };

int B1[][3]{ {1, 2, 1}, {0, 1, 1}, {0, 0, 1} };



void initMatrixes()

{

	FOR(i, 0, 3)

	{

		FOR(j, 0, 3)

		{

			A.A[i][j] = A1[i][j];

			B.A[i][j] = B1[i][j];

		}

	}

}



int main()

{

	//freopen("in.txt", "r", stdin);

	//freopen("out.txt", "w", stdout);

	ios::sync_with_stdio(false); cin.tie(0);

	int n, m;

	cin >> n >> m;

	FOR(i, 0, m) cin >> X[i];



	initMatrixes();

	Matrix R;

	

	R.one();

	FOR(i, 0, m)

	{

		if (i == 0)

		{

			R = R * bp(A, X[i] - 1);

		}

		else

		{

			R = R * bp(A, X[i] - X[i - 1] - 1);

		}



		R = R * B;

		//R.print();

	}



	R = R * bp(A, n - X[m - 1]);



	//LL ans = R.A[0][0] + R.A[0][1] + R.A[0][2];

	//ans %= MOD;

	cout << R.A[0][2] << endl;

}

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

#include<algorithm>

#include<cstring>

using namespace std;

#define N 100005

#define MOD 1000000007

#define LL long long

int x[N],n,m;

bool vis[N];

struct node

{

	LL a[3][3];

}A,C,a,b,c,tmp;

int f[3],g[3];

node Mul(node res,node X,node Y)

{

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

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

			tmp.a[i][j]=0;

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

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

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

				tmp.a[i][j]=(tmp.a[i][j]+X.a[i][k]*Y.a[k][j]%MOD)%MOD;

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

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

			res.a[i][j]=tmp.a[i][j];

	return res;

}

void Pow(int X)

{

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

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

			c.a[i][j]=C.a[i][j];

	while(X)

	{

		if(X&1) a=Mul(a,a,c);

		c=Mul(c,c,c);

		X>>=1;

	}

}

int main()

{

	scanf("%d %d",&n,&m);

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

		scanf("%d",&x[i]);

	memset(A.a,0,sizeof(A.a));

	memset(C.a,0,sizeof(C.a));

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

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

	C.a[0][2]=C.a[1][0]=C.a[1][1]=C.a[1][2]=C.a[2][0]=C.a[2][2]=1;

	C.a[0][0]=C.a[0][1]=2;

	f[0]=1;

	x[++m]=n;

	for(int l=1,pos=0;l<=m;l++)

	{

		int k=x[l]-pos-1;

		memset(b.a,0,sizeof(b.a));

		memset(a.a,0,sizeof(a.a));

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

			a.a[i][i]=1;

		if(k) Pow(k);

		b=Mul(b,a,A);

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

		{

			g[i]=0;

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

				g[i]=(g[i]+f[j]*b.a[j][i]%MOD)%MOD;

		}

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

			f[i]=g[i];

		pos=x[l];

	}

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

}