// Slower C++ solution:
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include<complex>

using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



const int MAX = 1000 * 100 + 47;

const int MOD = 1000 * 1000 * 1000 + 7;



struct Matrix

{

	LL A[3][3];

	void one()

	{

		FILL(A, 0);

		A[0][0] = A[1][1] = A[2][2] = 1;

	}



	Matrix operator *(const Matrix& T)

	{

		Matrix res;

		FOR(i, 0, 3)

		{

			FOR(j, 0, 3)

			{

				res.A[i][j] = 0;

				FOR(k, 0, 3)

				{

					res.A[i][j] = (res.A[i][j] + A[i][k] * T.A[k][j]) % MOD;

				}

			}

		}



		return res;

	}



	void print()

	{

		FOR(i, 0, 3)

		{

			FOR(j, 0, 3) cout << A[i][j] << " ";

			cout << endl;

		}

	}

};



//static VI operator *(const VI& V, const Matrix& M)

//{

//	VI R(SZ(V), 0);

//	FOR(i, 0, 3)

//	{

//		FOR(k, 0, 3)

//		{

//			R[i] = (R[i] + V[i] * M.A[k][i]) % MOD;

//		}

//	}

//

//	return R;

//}



Matrix bp(Matrix A, int n)

{

	Matrix R;

	R.one();

	while (n)

	{

		if (n & 1) R = R * A;

		

		n >>= 1;

		A = A * A;

	}



	return R;

}



int X[MAX];

Matrix A, B;

int A1[][3]{ {2, 2, 1}, {1, 1, 1}, {1, 0, 1} };

int B1[][3]{ {1, 2, 1}, {0, 1, 1}, {0, 0, 1} };



void initMatrixes()

{

	FOR(i, 0, 3)

	{

		FOR(j, 0, 3)

		{

			A.A[i][j] = A1[i][j];

			B.A[i][j] = B1[i][j];

		}

	}

}



int main()

{

	//freopen("in.txt", "r", stdin);

	//freopen("out.txt", "w", stdout);

	ios::sync_with_stdio(false); cin.tie(0);

	int n, m;

	cin >> n >> m;

	FOR(i, 0, m) cin >> X[i];



	initMatrixes();

	Matrix R;

	

	R.one();

	FOR(i, 0, m)

	{

		if (i == 0)

		{

			R = R * bp(A, X[i] - 1);

		}

		else

		{

			R = R * bp(A, X[i] - X[i - 1] - 1);

		}



		R = R * B;

		//R.print();

	}



	R = R * bp(A, n - X[m - 1]);



	//LL ans = R.A[0][0] + R.A[0][1] + R.A[0][2];

	//ans %= MOD;

	cout << R.A[0][2] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 4.890006418102071x):
#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;

}