#include <bits/stdc++.h>

typedef long long LL;

const int N=1e5+10,Mod=1e9+7;

int n,m,x[N];

struct Matrix {
	int x,y,a[3][3];
	
	void Clear() { for (int i=0;i<x;++i) for (int j=0;j<y;++j) a[i][j]=0; }
	
	Matrix operator * (const Matrix &A) const {
		Matrix ret; ret.x=x; ret.y=A.y; ret.Clear();
		for (int i=0;i<ret.x;++i)
			for (int j=0;j<ret.y;++j) {
				ret.a[i][j]=0;
				for (int k=0;k<y;++k)
					ret.a[i][j]=(ret.a[i][j]+1ll*a[i][k]*1ll*A.a[k][j])%Mod;
			}
		return ret;
	}
	
}a,b,p,ans;

void Init() {
	scanf("%d%d",&n,&m);
	for (int i=1;i<=m;++i) scanf("%d",&x[i]);
}

void power(const Matrix &a,int t,Matrix &ret) {
	Matrix p=a;
	ret.x=3; ret.y=3; ret.Clear();
	for (int i=0;i<3;++i) ret.a[i][i]=1;
	while (t) {
		if (t&1) ret=ret*p;
		p=p*p;
		t>>=1;
	}
}

void Solve() {
	a.x=3; a.y=3;
	a.a[0][0]=1; a.a[0][1]=2; a.a[0][2]=1;
	a.a[1][0]=0; a.a[1][1]=1; a.a[1][2]=1; 
	a.a[2][0]=1; a.a[2][1]=2; a.a[2][2]=2;
	
	b.x=3; b.y=3;
	b.a[0][0]=1; b.a[0][1]=2; b.a[0][2]=1;
	b.a[1][0]=0; b.a[1][1]=1; b.a[1][2]=1;
	b.a[2][0]=0; b.a[2][1]=0; b.a[2][2]=1;
	
	ans.x=1; ans.y=3;
	ans.a[0][0]=1; ans.a[0][1]=0; ans.a[0][2]=0; 
	
	int now=0;
	for (int i=1;i<=m;++i) {
		power(a,x[i]-now,p);
		ans=ans*p*b;
		now=x[i]+1;
	}
	power(a,n-now,p);
	ans=ans*p;
	printf("%d\n",(ans.a[0][2]%Mod+Mod)%Mod);
}

int main() {
	Init();
	Solve();
	return 0;	
}