// Slower C++ solution:
#include<map>

#include<set>

#include<stack>

#include<queue>

#include<cmath>

#include<cstring>

#include<climits>

#include<cstdio>

#include<iostream>

#include<algorithm>

using namespace std;

#define LL long long

//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)

//char buf[(1 << 21) + 1], *p1 = buf, *p2 = buf;

inline int read() {

	bool f=0;int x=0;char c=getchar();

	while(c<'0'||'9'<c){if(c==EOF)exit(0);if(c=='-')f=1;c=getchar();}

	while('0'<=c&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();

	return !f?x:-x;

}

#define MAXN 100000

#define INF 0x3f3f3f3f

#define Mod (int)(1e9+7)

struct Matrix{

	#define MAXC 4

	int r,c;

	LL m[MAXC+5][MAXC+5];

	void Init(int R,int C){

		r=R,c=C;

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

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

				m[i][j]=0;

		return ;

	}

	friend Matrix operator * (Matrix A,Matrix B){

		Matrix C;C.Init(A.r,B.c);

		for(int i=0;i<A.r;i++)

			for(int j=0;j<B.c;j++)

				for(int k=0;k<A.c;k++)

					C.m[i][j]=(C.m[i][j]+A.m[i][k]*B.m[k][j])%Mod;

		return C;

	}

	void Print(){

		puts("");

		for(int i=0;i<r;i++,puts(""))

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

				printf("%lld ",m[i][j]);

		puts("");

		return ;

	}

};

Matrix Pow(Matrix x,int y){

	Matrix ret;ret.Init(x.r,x.c);

	for(int i=0;i<ret.r;i++)

		ret.m[i][i]=1;

	while(y){

		if(y&1) ret=ret*x;

		x=x*x,y>>=1;

	}

	return ret;

}

Matrix A,B,C;

void Init(){

	A.Init(1,3),A.m[0][0]=1,A.m[0][1]=2,A.m[0][2]=1;

	B.Init(3,3);

	B.m[0][0]=1,B.m[0][1]=2,B.m[0][2]=1,

	B.m[1][0]=0,B.m[1][1]=1,B.m[1][2]=1,

	B.m[2][0]=1,B.m[2][1]=2,B.m[2][2]=2;

	C.Init(3,3);

	C.m[0][0]=1,C.m[0][1]=2,C.m[0][2]=1,

	C.m[1][0]=0,C.m[1][1]=1,C.m[1][2]=1,

	C.m[2][0]=0,C.m[2][1]=0,C.m[2][2]=1;

	return ;

}

int main(){

	int n=read(),m=read();

	Init();

	int lst=1;

	for(int i=1;i<=m;i++){

		int x=read();

		A=A*Pow(B,x-lst);

		A=A*C;

		lst=x+1;

	}

	A=A*Pow(B,n-lst);

	printf("%lld\n",A.m[0][2]);

	return 0;

}


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

#include <algorithm>

using namespace std;

typedef long long LL;

const int mod = 1e9 + 7;

struct matrix {

	LL a[10][10];

	int n , m;

	matrix operator + (const matrix &b) const {

		matrix c;

		for (int i = 1; i <= n; ++i) {

			for (int j = 1; j <= b.m; ++j) {

				c.a[i][j] = 0;

			}

		}

		for (int i = 1; i <= n; ++i) {

			for (int j = 1; j <= b.m; ++j) {

				c.a[i][j] = (a[i][j] + b.a[i][j]) % mod;

			}

		}

		c.n = n;

		c.m = b.m;

		return c;

	}

	matrix operator * (const matrix &b) const{

		matrix c;

		for (int i = 1; i <= n; ++i) {

			for (int j = 1; j <= b.m; ++j) {

				c.a[i][j] = 0;

			}

		}

		for (int i = 1; i <= n; ++i) {

			for (int k = 1; k <= m; ++k) {

				for (int j = 1; j <= b.m; ++j) {

					c.a[i][j] = (c.a[i][j] + a[i][k] * b.a[k][j] % mod) % mod;

				}

			}

		}

		c.n = n;

		c.m = b.m;

		return c;

	}

	void write() {

		for (int i = 1; i <= n; ++i) {

			for (int j = 1; j <= m; ++j) {

				printf("%lld " , a[i][j]);

			}

			putchar('\n');

		}

	}

}I; 

matrix qpow(matrix a , int b) {

	matrix res = I;

	while(b) {

		if(b & 1) res = res * a;

		a = a * a;

		b >>= 1;

	}

	return res;

}

int main() {

	matrix A , B;

	I.a[1][1] = I.a[2][2] = I.a[3][3] = 1;

	I.n = I.m = A.n = A.m = B.n = B.m = 3;

	A.a[1][1] = 1 , A.a[1][2] = 0 , A.a[1][3] = 1;

	A.a[2][1] = 1 , A.a[2][2] = 1 , A.a[2][3] = 1;

	A.a[3][1] = 1 , A.a[3][2] = 2 , A.a[3][3] = 2;

	B.a[1][1] = 1 , B.a[1][2] = 0 , B.a[1][3] = 0;

	B.a[2][1] = 1 , B.a[2][2] = 1 , B.a[2][3] = 0;

	B.a[3][1] = 1 , B.a[3][2] = 2 , B.a[3][3] = 1;

	matrix res = I;

	int n , m;

	scanf("%d %d" , &n , &m);

	int las = 0;

	for (int i = 1; i <= m; ++i) {

		int x;

		scanf("%d" , &x);

		matrix tmp = qpow(A , x - las - 1);

		res = res * tmp * B;

		las = x;

	}

	res = res * qpow(A , n - las - 1);

	printf("%lld" , (res.a[3][1] + res.a[3][2] + res.a[3][3]) % mod);

	return 0;

}