#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
#define dumpR(x) cerr<<"\x1b[31m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpY(x) cerr<<"\x1b[33m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpG(x) cerr<<"\x1b[32m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define dumpR(x) ;
#define dumpY(x) ;
#define dumpG(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}


template<lint mod>
struct Int_{
  unsigned x;
  unsigned mpow(Int_ a,unsigned k){
    Int_ res=1;
    while(k){
      if(k&1) res=res*a;
      a=a*a;
      k>>=1;
    }
    return res.x;
  }
  unsigned inverse(Int_ a){
    return mpow(a,mod-2);
  }
  Int_(): x(0) { }
  Int_(long long sig) {
    int sigt=sig%mod;
    if(sigt<0) sigt+=mod;
    x=sigt;
  }
  unsigned get() const { return (unsigned)x; }
  
  Int_ &operator+=(Int_ that) { if((x += that.x) >= mod) x -= mod; return *this; }
  Int_ &operator-=(Int_ that) { if((x += mod - that.x) >= mod) x -= mod; return *this; }
  Int_ &operator*=(Int_ that) { x = (unsigned long long)x * that.x % mod; return *this; }
  Int_ &operator=(Int_ that) { x=that.x; return *this;}
  Int_ &operator/=(Int_ that) { x=(unsigned long long) x * inverse(that.x)%mod; return *this;}
  bool operator==(Int_ that) const { return x==that.x; }
  bool operator!=(Int_ that) const { return x!=that.x; }

  Int_ operator-() const { return Int_(0)-Int_(*this);}
  Int_ operator+(Int_ that) const { return Int_(*this) += that; }
  Int_ operator-(Int_ that) const { return Int_(*this) -= that; }
  Int_ operator*(Int_ that) const { return Int_(*this) *= that; }
  Int_ operator/(Int_ that) const { return Int_(*this) /= that; }
  Int_ inv(){
    return Int_(mpow(x,mod-2));
  }
};

namespace std{
  template<lint mod>
  ostream &operator <<(ostream& out,const Int_<mod>& a){
    out<<a.get();
    return out;
  }
  template<lint mod>
  istream &operator >>(istream& in,Int_<mod>& a){
    in>>a.x;
    return in;
  }
};

typedef Int_<1000000007> Int;

Int mpow(Int a,lint k){
  Int res=1;
  while(k){
    if(k&1) res=res*a;
    a=a*a;
    k>>=1;
  }
  return res;
}

//const int INF=5e8;
const int N=3;
void mult(Int A[N][N],Int B[N][N],Int C[N][N]){
  REP(i,N) REP(j,N) C[i][j]=0;
  REP(i,N) REP(j,N) REP(k,N) C[i][j]+=A[i][k]*B[k][j];
}

void mpow(const Int A[N][N],lint k,Int B[N][N]){
  Int res[N][N],tmp[N][N];
  memcpy(B,A,sizeof(Int)*9);
  CLR(res);
  REP(i,N) res[i][i]=1;
  while(k){
    if(k&1){
      mult(B,res,tmp);
      memcpy(res,tmp,sizeof(tmp));
    }
    mult(B,B,tmp);
    memcpy(B,tmp,sizeof(tmp));
    k>>=1;
  }
  memcpy(B,res,sizeof(res));
}
int n,m;

int ar[100005];
int main(){
  cin>>n>>m;
  REP(i,m) scanf("%d",&ar[i]);

  Int dp[3];
  CLR(dp);
  dp[0]=1;
  Int A[3][3],B[3][3],A2[3][3];
  CLR(A);CLR(B);
  A[0][0]=2;
  A[1][0]=2;
  A[2][0]=1;
  A[0][1]=1;
  A[1][1]=1;
  A[2][1]=1;
  A[0][2]=1;
  A[1][2]=0;
  A[2][2]=1;
  memcpy(A2,A,sizeof(A));
  A2[0][0]=1;


  B[0][0]=1;
  B[1][0]=2;
  B[2][0]=1;
  B[0][1]=0;
  B[1][1]=1;
  B[2][1]=1;
  B[0][2]=0;
  B[1][2]=0;
  B[2][2]=1;

  auto doit2=[&](Int B[3][3]){
    Int tmp[3];
    CLR(tmp);
    REP(i,3) REP(j,3) tmp[i]+=B[i][j]*dp[j];
    memcpy(dp,tmp,sizeof(dp));
  };
  auto doit1=[&](int K){
    if(K<=0) return;
    Int C[3][3];
    mpow(A,K,C);

    Int tmp[3];
    CLR(tmp);
    REP(i,3) REP(j,3) tmp[i]+=C[i][j]*dp[j];
    memcpy(dp,tmp,sizeof(dp));
  };
  if(m==0){
    doit1(n-1);
    doit2(A2);
  }else{
    doit1(ar[0]-1);
    REP(i,m-1){
      doit2(B);
      doit1(ar[i+1]-ar[i]-1);
    }
    doit2(B);
    doit1(n-ar[m-1]-1);
    doit2(A2);
  }

  cout<<dp[0]<<endl;
  return 0;
}





Measured memory_bytes: 640