#include<cstdio>
#include<algorithm>
using namespace std;
int n, m, X[101000];
int w[101000], L[101000], Mod = 1000000007, G[32][3][3] = {{{0,1,0},{0,0,1},{1,Mod-2,4}}};
int R[3] = {0,1,5}, TP[3];
void Up(int x){
    int i, j, t = 0;
    while(x){
        if(x&1){
            for(i=0;i<3;i++)TP[i]=0;
            for(i=0;i<3;i++)for(j=0;j<3;j++)TP[i] = (TP[i]+1ll*G[t][i][j]*R[j])%Mod;
            for(i=0;i<3;i++)R[i]=TP[i];
        }
        t++;x>>=1;
    }
}
int main(){
    int i, j, k, l;
    for(i=1;i<32;i++){
        for(j=0;j<3;j++)for(k=0;k<3;k++)for(l=0;l<3;l++)G[i][j][k] = (G[i][j][k] + 1ll*G[i-1][j][l]*G[i-1][l][k])%Mod;
    }
    scanf("%d%d",&n,&m);
    for(i=1;i<=m+1;i++){
        if(i<=m)scanf("%d",&X[i]);
        else X[i] = n;
        Up(X[i]-X[i-1]);
        int d = R[0];
        R[1] = (R[1]-d+Mod)%Mod;
        R[2] = (R[2]-d*5ll%Mod+Mod)%Mod;
    }
    printf("%d\n",R[0]);
}