// Slower C++ solution:
#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>

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 = 3 * 1000 * 100 + 47;

const double EPS = 1e-8;

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





int A[4][4] =

{

    {1, 0, 0, 1},

    {1, 1, 0, 1},

    {1, 0, 1, 1},

    {1, 1, 1, 2}

};



int B[4][4] =

{

    {1, 0, 0, 0},

    {1, 1, 0, 0},

    {1, 0, 1, 0},

    {1, 1, 1, 1}

};



struct vect

{

    int A[4];

    vect()

    {

        FILL(A, 0);

    }

};



struct matrix

{

    int A[4][4];

    

    matrix()

    {

        FILL(A, 0);

    }

    

    matrix operator*(const matrix &m) const

    {

        matrix M;

        FOR(i, 0, 4)

            FOR(j, 0, 4)

                FOR(k, 0, 4)

                    M.A[i][j] = (M.A[i][j] + A[i][k] * 1LL* m.A[k][j]) % MOD;

        return M;

    }

    vect operator * (const vect& v) const

    {

        vect V;

        FOR(i, 0, 4)

            FOR(j, 0, 4)

                V.A[i] = (V.A[i] + A[i][j] * 1LL * v.A[j]) % MOD;

        return V;

    }

};





matrix BP(matrix M, int n)

{

    matrix RES;

    FOR(i, 0, 4)RES.A[i][i] = 1;

    while(n)

    {

        if (n & 1)RES = RES * M;

        M = M * M;

        n >>=1;

    }

    return RES;

}



int X[MAX];



int main()

{

    matrix A, B;

    FOR(i, 0, 4)FOR(j, 0, 4)A.A[i][j] = ::A[i][j];

    FOR(i, 0, 4)FOR(j, 0, 4)B.A[i][j] = ::B[i][j];

    

    int n, m;

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

    FOR(i, 0, m)

    scanf("%d", X + i);

    X[m++] = n;

    

    vect V;

    V.A[0] = 1;

    FOR(i, 0, m)

    {

        matrix M = BP(A, X[i] - (i ? X[i-1] : 0) - 1);

        V = (M * B) * V;

    }

    cout << V.A[3] << endl;

    

    

    

}

    

    


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

#include<algorithm>

#include<cstring>

using namespace std;

#define MAXN 100010

#define MO 1000000007

#define LL long long

int x[MAXN],n,m;

bool vis[MAXN];

void task1()

{

	static int dp[100010][3];

	dp[0][0]=1;

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

		vis[x[i]]=1;

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

	{

		dp[i][0]=dp[i-1][0];

		dp[i][1]=(dp[i-1][0]+dp[i-1][1])%MO;

		dp[i][2]=((dp[i-1][0]+dp[i-1][1])%MO+(dp[i-1][1]+dp[i-1][2])%MO)%MO;

		if(!vis[i-1])

		{

			dp[i][0]=(dp[i][0]+dp[i-1][2])%MO;

			dp[i][1]=(dp[i][1]+dp[i-1][2])%MO;

			dp[i][2]=(dp[i][2]+dp[i-1][2])%MO;

		}

	}

	printf("%d\n",dp[n][2]);

}

struct node

{

	LL a[3][3];

}A,C,a,b,c,tmp;

void Mul(node &ret,node X,node Y)

{

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

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

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

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

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

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

				tmp.a[i][j]=(tmp.a[i][j]+X.a[i][k]*Y.a[k][j]%MO)%MO;

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

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

			ret.a[i][j]=tmp.a[i][j];

}

void Pow(int X)

{

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

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

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

	while(X)

	{

		if(X&1) Mul(a,a,c);

		Mul(c,c,c);

		X>>=1;

	}

}

int f[3],g[3];

int main()

{

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

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

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

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

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

	memset(A.a,0,sizeof A.a);

	memset(C.a,0,sizeof C.a);

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

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

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

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

	f[0]=1;

	x[++m]=n;

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

	{

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

		memset(b.a,0,sizeof b.a);

		memset(a.a,0,sizeof a.a);

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

			a.a[i][i]=1;

		if(k) Pow(k);

		Mul(b,a,A);

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

		{

			g[i]=0;

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

				g[i]=(g[i]+f[j]*b.a[j][i]%MO)%MO;

		}

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

			f[i]=g[i];

		pos=x[l];

	}

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

}