// 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: 5.201284160724963x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<deque>

using namespace std;

typedef long long ll;

const int N=1e5+5;

const ll mod=1e9+7;

int n,m;

int x[N];

struct mat{

    ll a[3][3];

    mat(){memset(a,0,sizeof a);}

}A,C,e;

void debug(mat x){

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

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

            printf("%d ",x.a[i][j]);

    puts("");

}

mat operator *(mat x,mat y){

    mat z;

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

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

            for(int k=0;k<3;k++){

                z.a[i][j]+=x.a[i][k]*y.a[k][j];

                z.a[i][j]%=mod;

            }

    return z;

}

mat operator ^(mat x,int y){

    mat res=e;

    while(y){

        if(y&1)

            res=res*x;

        //debug(x);

        x=x*x;

        //debug(res);

        //debug(x);

        y>>=1;

    }

    return res;

}

ll f[3],g[3];

int main()

{

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

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

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

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

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

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

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

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

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

    e.a[0][0]=1,e.a[0][1]=0,e.a[0][2]=0;

    e.a[1][0]=0,e.a[1][1]=1,e.a[1][2]=0;

    e.a[2][0]=0,e.a[2][1]=0,e.a[2][2]=1;

    f[0]=1;

    x[++m]=n;

    for(int t=1,pos=0;t<=m;t++){

        int k=x[t]-pos-1;

        mat z=C^k;

        z=z*A;

        for(int i=0;i<3;i++){

            g[i]=0;

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

                g[i]=(g[i]+f[j]*z.a[j][i]%mod)%mod;

        }

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

            f[i]=g[i];

        pos=x[t];

    }

    printf("%lld\n",f[2]);

}