#include<cstdio>
#include<cstring>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,b,a) for(int i=b;i>=a;i--)
#define mset(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
typedef int mat[3][3];
char ch;
int read(){int n=0,p=1;for(ch=getchar();ch<'0' || '9'<ch;ch=getchar())if(ch=='-') p=-1;for(;'0'<=ch && ch<='9';ch=getchar()) n=n*10+ch-'0';return n*p;}
const int M=1e5+5,mo=1e9+7;
int n,m;
mat C,A={{1,2,1},{0,1,1},{1,2,2}},B={{1,2,1},{0,1,1},{0,0,1}};
void mul(mat &c,mat a,mat b)
{
	static mat p;mset(p,0);
	fo(i,0,2)
		fo(j,0,2)
			fo(k,0,2) p[i][j]=(p[i][j]+(ll)a[i][k]*b[k][j]%mo)%mo;
	fo(i,0,2) fo(j,0,2) c[i][j]=p[i][j];
}
void qmi(int n)
{
	static mat a;
	fo(i,0,2) fo(j,0,2) a[i][j]=A[i][j];
	for(;n;n>>=1)
	{
		if(n&1) mul(C,C,a);
		mul(a,a,a);
	}
}
int main()
{
	n=read(),m=read();
	fo(i,0,2) C[i][i]=1;
	int lst=0;
	fo(i,1,m)
	{
		int x=read();
		qmi(x-lst);
		mul(C,C,B);
		lst=x+1;
	}
	qmi(n-lst);
	printf("%d",C[0][2]);
	return 0;
}
