#include<iostream>
#include<cstring>
#include<cstdio>
#define LL long long
using namespace std;
int n,m;
const int N=100010,mod=1e9+7;
int a[N];
struct ju
{
	LL v[3][3];
	ju(){memset(v,0,sizeof(v));}
	friend ju operator *(const ju &a,const ju &b)
	{
		ju c;
		for(int i=0;i<=2;++i)
			for(int j=0;j<=2;++j)
				for(int k=0;k<=2;++k)
					(c.v[i][j]+=a.v[i][k]*b.v[k][j])%=mod;
		return c;
	}
}A,B,Ans;
ju ksm(ju a,LL b)
{
	ju res;res.v[0][0]=res.v[1][1]=res.v[2][2]=1;
	for(;b;b>>=1,a=a*a)
		if(b&1)res=res*a;
	return res;
}
signed main()
{
	cin>>n>>m;
	for(int i=1;i<=m;++i)scanf("%d",&a[i]);
	A.v[0][0]=A.v[1][0]=A.v[1][2]=2;
	A.v[0][1]=A.v[0][2]=A.v[1][1]=A.v[2][0]=A.v[2][2]=1;
	
	B.v[0][0]=B.v[0][1]=B.v[0][2]=B.v[1][1]=B.v[2][2]=1;
	B.v[1][2]=2;
	
	Ans.v[0][0]=1;
	for(int i=1;i<=m;++i)Ans=Ans*ksm(A,a[i]-a[i-1]-1)*B;
	Ans=Ans*ksm(A,n-a[m]);
	cout<<Ans.v[0][2];
	return 0;
}
/*
3 1 
2

13

5 2
2 3

66

10 9
1 2 3 4 5 6 7 8 9

100
*/