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

}

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

#include<algorithm>

#include<cstring>

using namespace std;

#define MAXN 100010

#define MO 1000000007

#define LL long long

int x[MAXN],n,m;

bool vis[MAXN];

struct node

{

	LL a[3][3];

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

void Mul(node &ret,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]%MO)%MO;

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

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

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

}

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) Mul(a,a,c);

		Mul(c,c,c);

		X>>=1;

	}

}

int f[3],g[3];

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);

		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]%MO)%MO;

		}

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

			f[i]=g[i];

		pos=x[l];

	}

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

}