#include<cstdio> 
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
using namespace std;
#define fo(i,j,k) for(i=j;i<=k;i++)
#define fd(i,j,k) for(i=j;i>=k;i--)
#define cmax(a,b) (a=(a>b)?a:b)
#define cmin(a,b) (a=(a<b)?a:b)
typedef long long ll;
const int N=1e6+5,M=2e6+5,mo=1e9+7;
int f[3],A[3][3],B[3][3],C[3][3],D[3][3],a[3][3],b[3][3],c[3][3],g[3];
int d[N],n,m,x,i,j,k,pos,l;
void ksm(int x)
{
	int i,j,k;
	fo(i,0,2) fo(j,0,2) c[i][j]=C[i][j];
	while(x)
	{
		if (x&1)
		{
			fo(i,0,2) fo(j,0,2) D[i][j]=0;
			fo(i,0,2) fo(j,0,2) fo(k,0,2)
				D[i][j]=(D[i][j]+1ll*a[i][k]*c[k][j])%mo;
			fo(i,0,2) fo(j,0,2) a[i][j]=D[i][j];
		}
		x>>=1;
		fo(i,0,2) fo(j,0,2) D[i][j]=0;
		fo(i,0,2) fo(j,0,2) fo(k,0,2)
			D[i][j]=(D[i][j]+1ll*c[i][k]*c[k][j])%mo;
		fo(i,0,2) fo(j,0,2) c[i][j]=D[i][j];
	}
}
int main()
{
	scanf("%d %d",&n,&m);
	fo(i,1,m) scanf("%d",d+i);
	pos=0;// finished pos
	f[0]=1;
	A[0][1]=2;A[1][2]=1;A[0][2]=1;
	A[0][0]=1;A[1][1]=1;A[2][2]=1;
	B[2][0]=1;B[0][0]=1;B[1][1]=1;B[2][2]=1;
	fo(i,0,2) fo(j,0,2) 
		fo(k,0,2) 
			C[i][j]+=A[i][k]*B[k][j];
	d[++m]=n;
	fo(l,1,m)
	{
		x=d[l]-pos-1;
		fo(i,0,2) fo(j,0,2) b[i][j]=a[i][j]=0;
		fo(i,0,2) a[i][i]=1;
		if (x)
			ksm(x);//use C, prod in a
		fo(i,0,2) fo(j,0,2) fo(k,0,2) b[i][j]=(b[i][j]+1ll*a[i][k]*A[k][j])%mo;
		fo(i,0,2) g[i]=0;
		fo(i,0,2) fo(j,0,2) g[j]=(g[j]+1ll*f[i]*b[i][j])%mo;
		fo(i,0,2) f[i]=g[i];
		pos=d[l];
	}
	printf("%d",f[2]);
}