// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

 

using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



const int MOD=1e9+7;

const int DIM = 4;



struct Matrix {

  int a[DIM][DIM];

  int *operator [] (int r) { return a[r]; };



  Matrix(int x = 0) {

    memset(a, 0, sizeof a);

    if (x)

    {

		for(int i = 0; i < DIM; i++) a[i][i] = x;

	}

  }

} const I(1);



Matrix operator * (Matrix A, Matrix B) {

  const ll mod2 = ll(MOD) * MOD;

  Matrix C;

 for(int i = 0; i < DIM; i++)

 {

	 for(int j = 0; j < DIM; j++)

	 {

		ll w = 0;

		for(int k = 0; k < DIM; k++)

		{

			w += ll(A[i][k]) * B[k][j];

			if (w >= mod2) w -= mod2;

		}

	C[i][j] = w % MOD;

	}

  }

  return C;

}



Matrix operator ^ (Matrix A, ll b) {

  Matrix R = I;

  for (; b > 0; b /= 2) {

    if (b % 2) R = R*A;

    A = A*A;

  }

  return R;

}



void add(ll &a, ll b)

{

	a+=b;

	while(a>=MOD) a-=MOD;

}



ll mult(ll a, ll b)

{

	return (a*b)%MOD;

}



Matrix M1,M2;



vector<ll> mult(Matrix &a, vector<ll> cur)

{

	vector<ll> V(4,0);

	for(int i = 0; i < 4; i++)

	{

		for(int j = 0; j < 4; j++)

		{

			add(V[i], mult(a[i][j],cur[j]));

		}

	}

	return V;

}



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	ll n,k;

	cin>>n>>k;

	vi vec;

	for(int i=0;i<k;i++)

	{

		ll x; cin>>x; vec.pb(x);

	}

	vec.pb(n);

	for(int i=0;i<4;i++)

	{

		for(int j=0;j<4;j++)

		{

			if((j&i)==j)

			{

				M1[i][j]=M2[i][j]=1;

			}

		}

		M1[i][3]++;

	}

	vector<ll> V = {1,1,1,1};

	int cur = 1;

	for(int i = 0; i < vec.size(); i++)

	{

		int ext = vec[i] - cur;

		Matrix M = M1^ext;

		V = mult(M, V);

		cur = vec[i];

		if(cur==n) break;

		cur++;

		V = mult(M2,V);

	}

	cout<<V[3]<<'\n';

}


// Faster C++ solution for the same problem (measured speedup: 5.201920361022605x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MAXM 100000

#define MO 1000000007

using namespace std;

struct Matrix

{

	int M[4][4];

	Matrix operator * (const Matrix &b)

	{

		Matrix ret;

		for(int i=1;i<=3;i++)

			for(int j=1;j<=3;j++)

			{

				ret.M[i][j]=0;

				for(int k=1;k<=3;k++)

					ret.M[i][j]=(1LL*ret.M[i][j]+1LL*M[i][k]*b.M[k][j]%MO)%MO;

			}

		return ret;

	}

};

int x[MAXM+5],N,M;

int finans[4],d[4];

Matrix PowMod(Matrix a,int b)

{

	Matrix ret;

	for(int i=1;i<=3;i++)

		for(int j=1;j<=3;j++)

		{

			if(i==j)

				ret.M[i][j]=1;

			else

				ret.M[i][j]=0;

		}

	while(b)

	{

		if(b&1)

			ret=ret*a;

		a=a*a;

		b>>=1;

	}

	return ret;

}

int main()

{

	scanf("%d %d",&N,&M);

	for(int i=1;i<=M;i++)

		scanf("%d",&x[i]),x[i]++;

	sort(x+1,x+1+M);

	Matrix ans,usu,ususpe;

	//===========================================

	usu.M[1][1]=1,usu.M[1][2]=0,usu.M[1][3]=0;

	usu.M[2][1]=1,usu.M[2][2]=1,usu.M[2][3]=0;

	usu.M[3][1]=1,usu.M[3][2]=2,usu.M[3][3]=1;

	//===========================================

	ususpe.M[1][1]=1,ususpe.M[1][2]=0,ususpe.M[1][3]=1;

	ususpe.M[2][1]=1,ususpe.M[2][2]=1,ususpe.M[2][3]=1;

	ususpe.M[3][1]=1,ususpe.M[3][2]=2,ususpe.M[3][3]=2;

	//===========================================

	d[1]=d[2]=d[3]=1;

	int pre=1;

	for(int i=1;i<=M;i++)

	{

		ans=PowMod(ususpe,x[i]-pre-1);

		memset(finans,0,sizeof(finans));

		for(int j=1;j<=3;j++)

			for(int k=1;k<=3;k++)

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		ans=usu;

		memset(finans,0,sizeof(finans));

		for(int j=1;j<=3;j++)

			for(int k=1;k<=3;k++)

				finans[j]=(1LL*finans[j]+1LL*ans.M[j][k]*d[k]%MO)%MO;

		d[1]=finans[1],d[2]=finans[2],d[3]=finans[3];

		pre=x[i];

	}

	ans=PowMod(ususpe,N-pre);

	memset(finans,0,sizeof(finans));

	for(int i=1;i<=3;i++)

		for(int j=1;j<=3;j++)

			finans[i]=(1LL*finans[i]+1LL*ans.M[i][j]*d[j]%MO)%MO;

	printf("%d\n",finans[3]);

	return 0;

}