//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
typedef long long ll;
const int Imx=2147483647;
const int mod=1000000007;
const ll Lbig=2e18;
//My own input/output stream
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putsp()
#define putii(x,y) puti(x),putnum(y),putsp()
#define putiii(x,y,z) putii(x,y),putnum(z),putsp()
#define putsi(x) putnum(x),putendl()
#define putsii(x,y) puti(x),putnum(y),putendl()
#define putsiii(x,y,z) putii(x,y),putnum(z),putendl()
inline ll getnum()
{
	register ll r=0;register bool ng=0;register char c;c=getchar();
	while(c!='-'&&(c<'0'||c>'9'))c=getchar();
	if(c=='-')ng=1,c=getchar();
	while(c>='0'&&c<='9')r=r*10+c-'0',c=getchar();
	if(ng)r=-r;return r;
}
template <class T> inline void putnum(T x)
{
	if(x<0)putchar('-'),x=-x;
	register short a[20]={},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1;i>=0;i--)putchar('0'+a[i]);
}
inline void putsp(){putchar(' ');}
inline void putendl(){putchar('\n');}
inline char mygetchar(){register char c=getchar();while(c==' '||c=='\n')c=getchar();return c;}
int n,m,a[100111];
const int coef[4]={0,4,mod-2,1};
const int ia[3]={0,1,4};
vector<ll> multi(vector<ll> &v1,vector<ll> &v2,bool f=0)
{
	vector<ll> ret(6);
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<3;j++)
		{
			ret[i+j+f]+=v1[i]*v2[j];
		}
	}
	for(int j=0;j<6;j++)ret[j]%=mod;
	return ret;
}
void rollback(vector<ll> &ret)
{
	for(int i=5;i>=3;i--)
	{
		ret[i]%=mod;
		for(int j=1;j<4;j++)
		{
			ret[i-j]+=ret[i]*coef[j];
		}
		ret[i]=0;
	}
	for(int i=0;i<6;i++)ret[i]%=mod;
}
vector<ll> calcfv(ll k)
{
	vector<ll> ret(6);
	if(k<3)
	{
		ret[k]=1;
		return ret;
	}
	vector<ll> v=calcfv(k>>1);
	bool f=k&1;
	ret=multi(v,v,f);
	rollback(ret);
//	cout<<"calcfv:"<<k<<endl;
//	for(int i=0;i<6;i++)cout<<ret[i]<<" ";cout<<endl;
	return ret;
}
ll calcf(ll k)
{
	vector<ll> v=calcfv(k);
	ll ans=0;
	for(int i=0;i<3;i++)ans+=ia[i]*v[i];
	return ans%mod;
}
vector<ll> calcv(ll k)
{
	vector<ll> v=calcfv(k);
	vector<ll> v1=calcfv(k-1);
	for(int i=0;i<3;i++)v[i]=(v[i]+v1[i])%mod;
	return v;
}
ll calc(ll k)
{
	return (calcf(k)+calcf(k-1))%mod;
}
ll dp[100111];
vector<ll> sum[100111];
int main()
{
	getii(n,m);
	for(int i=1;i<=m;i++)geti(a[i]);
	a[++m]=n;
	for(int i=0;i<6;i++)sum[0].PB(0);
	for(int i=1;i<=m;i++)
	{
//		cout<<"i="<<i<<endl;
		vector<ll> tv=calcfv(a[i]-a[i-1]-1);
//		for(int j=0;j<3;j++)cout<<tv[j]<<" ";cout<<endl;
		sum[i]=sum[i-1];
		sum[i]=multi(sum[i],tv);
		rollback(sum[i]);
//		cout<<a[i]-1<<":";for(int j=0;j<3;j++)cout<<sum[i][j]<<" ";cout<<endl;
		dp[i]=calc(a[i]);
//		cout<<dp[i]<<endl;
		for(int j=0;j<3;j++)dp[i]-=ia[j]*sum[i][j];
		for(int j=2;j>=0;j--)sum[i][j+1]=sum[i][j];
		sum[i][0]=0;
		rollback(sum[i]);
//		cout<<a[i]<<":";for(int j=0;j<3;j++)cout<<sum[i][j]<<" ";cout<<endl;
		for(int j=0;j<3;j++)dp[i]-=ia[j]*sum[i][j];
		dp[i]=(dp[i]%mod+mod)%mod;
//		cout<<dp[i]<<"-";
		sum[i][0]=(sum[i][0]+dp[i])%mod;
//		cout<<a[i]<<":";
/*		for(int j=0;j<3;j++)
		{
			cout<<sum[i][j]<<" ";
		}cout<<endl;*/
	}
	cout<<dp[m]<<endl;
	return 0;
}

Measured memory_bytes: 9984