#include<cstdio>
#include<cstring>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define N 3
#define mo 1000000007
#define ll long long
using namespace std;
int n,m;
struct node{
	ll a[N][N];
	node friend operator *(node a,node b)
	{
		node c;memset(c.a,0,sizeof(c.a));
		fo(i,0,2) fo(j,0,2) fo(k,0,2) c.a[i][k]=(c.a[i][k]+a.a[i][j]*b.a[j][k])%mo;
		return c;
	}
}a,b,c,ans;
void calc(int x)
{
	if(x<1) return;
	node q=a;
	for(;x;x/=2,q=q*q) if(x%2==1) ans=ans*q;
}
int main()
{
	scanf("%d%d",&n,&m);
	int las=1;
	a.a[1][0]=a.a[0][2]=a.a[1][1]=a.a[1][2]=a.a[2][0]=a.a[2][2]=1;
	a.a[0][0]=a.a[0][1]=2;
	b=a;
	b.a[0][0]=1;
	b.a[1][0]=b.a[2][0]=0;
	ans.a[0][0]=1;
	c.a[0][0]=c.a[1][0]=c.a[2][0]=1;
	while(m--)
	{
		int x;scanf("%d",&x);
		calc(x-las);las=x+1;
		ans=ans*b;
	}
	calc(n-las);
	ans=ans*c;
	printf("%lld\n",ans.a[0][0]);
}