// Slower C++ solution:
#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;

}

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

#include<cstring>

#include<algorithm>

#define MAXM 100000

#define MO 1000000007

using namespace std;

struct Matrix

{

	int M[4][4];

	Matrix operator * (const Matrix &b)

	{

		Matrix ret;

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

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

			{

				ret.M[i][j]=0;

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

					ret.M[i][j]=(1LL*ret.M[i][j]+1LL*M[i][k]*b.M[k][j]%MO)%MO;

			}

		return ret;

	}

};

int x[MAXM+5],N,M;

int finans[4],d[4];

Matrix PowMod(Matrix a,int b)

{

	Matrix ret;

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

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

		{

			if(i==j)

				ret.M[i][j]=1;

			else

				ret.M[i][j]=0;

		}

	while(b)

	{

		if(b&1)

			ret=ret*a;

		a=a*a;

		b>>=1;

	}

	return ret;

}

int main()

{

	scanf("%d %d",&N,&M);

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

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

	sort(x+1,x+1+M);

	Matrix ans,usu,ususpe;

	//===========================================

	usu.M[1][1]=1,usu.M[1][2]=0,usu.M[1][3]=0;

	usu.M[2][1]=1,usu.M[2][2]=1,usu.M[2][3]=0;

	usu.M[3][1]=1,usu.M[3][2]=2,usu.M[3][3]=1;

	//===========================================

	ususpe.M[1][1]=1,ususpe.M[1][2]=0,ususpe.M[1][3]=1;

	ususpe.M[2][1]=1,ususpe.M[2][2]=1,ususpe.M[2][3]=1;

	ususpe.M[3][1]=1,ususpe.M[3][2]=2,ususpe.M[3][3]=2;

	//===========================================

	d[1]=d[2]=d[3]=1;

	int pre=1;

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

	{

		ans=PowMod(ususpe,x[i]-pre-1);

		memset(finans,0,sizeof(finans));

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

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

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		ans=usu;

		memset(finans,0,sizeof(finans));

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

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

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		pre=x[i];

	}

	ans=PowMod(ususpe,N-pre);

	memset(finans,0,sizeof(finans));

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

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

			finans[i]=(1LL*finans[i]+1LL*ans.M[i][j]*d[j]%MO)%MO;

	printf("%d\n",finans[3]);

	return 0;

}