#include<iostream>
#include<cstring>
#include<cstdio>
#define MN 100000
#define mod 1000000007
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
struct Vec
{
	int s[3];
	Vec(){memset(s,0,sizeof(s));}
	Vec operator * (int y)
	{
		Vec c;
		for(int i=0;i<3;++i) c.s[i]=1LL*s[i]*y%mod;
		return c;
	}
	Vec operator + (const Vec&b)
	{
		Vec res;
		for(int i=0;i<3;++i) res.s[i]=(s[i]+b.s[i])%mod;
		return res;	
	}
}s,I;
struct Matrix
{
	int s[3][3];
	Matrix(){memset(s,0,sizeof(s));}
	Matrix operator * (const Matrix&b)
	{
		Matrix c;
		for(int i=0;i<3;++i)for(int k=0;k<3;++k)if(s[i][k])
			for(int j=0;j<3;++j) c.s[i][j]=(c.s[i][j]+1LL*s[i][k]*b.s[k][j])%mod;
		return c;
	}
	Vec operator * (const Vec&b)
	{
		Vec res;
		for(int i=0;i<3;++i) for(int j=0;j<3;++j)
			res.s[i]=(res.s[i]+1LL*s[i][j]*b.s[j])%mod;
		return res;	
	}
}A;
Matrix Pow(int x)
{
	Matrix B=A,C=A;
	for(--x;x;x>>=1,C=C*C) if(x&1) B=B*C;
	return B;
}
int n,m,x[MN+5],f[MN+5];
int main()
{
	A.s[1][0]=A.s[2][1]=1;
	A.s[0][0]=4;A.s[0][1]=mod-2;A.s[0][2]=1;
	I.s[0]=0;I.s[1]=1;I.s[2]=3;s=I*(mod-1);
	n=read();m=read();
	for(int i=1;i<=m;++i) x[i]=read();x[++m]=n;
	for(int i=1;i<=m;++i)
	{
		s=Pow(x[i]-x[i-1])*s;f[i]=(mod-s.s[0])%mod;
		s=s+I*f[i]; 
	}
	printf("%d\n",f[m]);
	return 0;
}