#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 102000,mo=1e9+7;
inline void add(int &x, int y){x=x+y<mo?x+y:x+y-mo;}
int n,m,a[N],b[3][3],c[3][3],d[3][3],ans[3][3];
void mul(int a[3][3],int b[3][3],int _c[3][3]){
	int c[3][3]={0};
	rep(i,0,2)rep(k,0,2)rep(j,0,2)add(c[i][j],1LL*a[i][k]*b[k][j]%mo);
	memcpy(_c,c,sizeof(c));
}
int main() {
	read(n);read(m);
	rep(i,1,m)read(a[i]);a[++m]=n;
	b[0][0]=1;b[1][0]=2;b[1][1]=1;b[2][0]=1;b[2][1]=1;b[2][2]=1;
	c[0][0]=1;c[0][1]=1;c[0][2]=1;
	rep(i,0,2)rep(j,0,2)d[i][j]=b[i][j]+c[i][j];
	rep(i,0,2)ans[i][i]=1;
	rep(i,1,m){
		int e[3][3];memcpy(e,d,sizeof(e));int t=a[i]-a[i-1]-1;
		while(t){
			if(t&1)mul(e,ans,ans);//swap??
			mul(e,e,e);t>>=1;
		}
	//	printf("<%d %d %d>\n",ans[0][0],ans[1][0],ans[2][0]);
		if(i<m)mul(b,ans,ans);else mul(c,ans,ans);
	}
	printf("%d",ans[0][0]);
	return 0;
}
