#include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<=y;i++)

const int RLEN=1<<18|1;
inline char nc() {
	static char ibuf[RLEN],*ib,*ob;
	(ib==ob) && (ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
	return (ib==ob) ? -1 : *ib++;
}
inline int rd() {
	char ch=nc(); int i=0,f=1;
	while(!isdigit(ch)) {if(ch=='-')f=-1; ch=nc();}
	while(isdigit(ch)) {i=(i<<1)+(i<<3)+ch-'0'; ch=nc();}
	return i*f;
}

const int mod=1e9+7;
inline int add(int x,int y) {return (x+y>=mod) ? (x+y-mod) : (x+y);}
inline int dec(int x,int y) {return (x-y<0) ? (x-y+mod) : (x-y);}
inline int mul(int x,int y) {return (long long)x*y%mod;}
inline int power(int a,int b,int rs=1) {for(;b;b>>=1,a=mul(a,a)) if(b&1) rs=mul(rs,a); return rs;}

int n,m;
const int T1[3][3]={ {2,1,1},
					 {2,1,2},
					 {1,0,1} };
const int T2[3][3]={ {1,1,1},
					 {0,1,2},
					 {0,0,1} }; 
struct matrix {
	int a[3][3];
	matrix (int t=0) {memset(a,0,sizeof(a)); rep(i,0,2) a[i][i]=t;}
	friend inline matrix operator *(const matrix &a,const matrix &b) {
		matrix c(0);
		rep(i,0,2) rep(k,0,2) rep(j,0,2) c.a[i][j]=add(c.a[i][j],mul(a.a[i][k],b.a[k][j]));
		return c;
	}
	friend inline matrix operator ^(matrix a,int b) {
		matrix c(1);
		for(;b;b>>=1,a=a*a) if(b&1) c=c*a;
		return c;
	}
} A,tr1,tr2;

int main() {
	n=rd(), m=rd();
	A.a[0][0]=1;
	memcpy(tr1.a,T1,sizeof(T1));
	memcpy(tr2.a,T2,sizeof(T2));
	int lst=0;
	for(int i=1;i<=m;++i) {
		int nxt=rd();
		A=A*(tr1^(nxt-lst-1));
		A=A*tr2; lst=nxt;
	}
	A=A*(tr1^(n-lst)); 
	cout<<A.a[0][2]<<'\n';
}