#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007

int n,m,x[111116];

struct matrix{
	long long f[3][3];
}a,b,e,f;

matrix operator *(matrix a,matrix b){
	static matrix c;
	memset(c.f,0,sizeof(c.f));
	for (int i=0;i<=2;i++)
		for (int j=0;j<=2;j++)
			for (int k=0;k<=2;k++)
				c.f[i][j]=(c.f[i][j]+a.f[i][k]*b.f[k][j])%mod;
	return c;
}

matrix power(matrix x,int y){
	static matrix t;t=e;
	for (;y;x=x*x,y/=2)
		if (y&1) t=t*x;
	return t;
}

int read(){
	int x=0;char ch=getchar();
	for (;!isdigit(ch);ch=getchar());
	for (;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return x;
}

int main(){
	a.f[0][0]=1;a.f[0][1]=2;a.f[0][2]=1;
	a.f[1][0]=0;a.f[1][1]=1;a.f[1][2]=1;
	a.f[2][0]=0;a.f[2][1]=0;a.f[2][2]=1;
	
	b.f[0][0]=1;b.f[0][1]=0;b.f[0][2]=0;
	b.f[1][0]=0;b.f[1][1]=1;b.f[1][2]=0;
	b.f[2][0]=1;b.f[2][1]=0;b.f[2][2]=1;
	
	e.f[0][0]=1;e.f[0][1]=0;e.f[0][2]=0;
	e.f[1][0]=0;e.f[1][1]=1;e.f[1][2]=0;
	e.f[2][0]=0;e.f[2][1]=0;e.f[2][2]=1;
	
	f.f[0][0]=1;
	
	n=read();m=read();
	for (int i=1;i<=m;i++) x[i]=read();
	for (int i=1;i<=m;i++) f=f*power(a*b,x[i]-x[i-1]-1)*a;
	f=f*power(a*b,n-x[m]);
	printf("%lld\n",f.f[0][2]);
	return 0;
}