#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define int long long
#define st first
#define nd second
#define rd third
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define RE(i, n) FOR(i, 1, n)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define REP(i, n) for(int i = 0;i <(n); ++i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t) {
  while(*sdbg != ',')cerr<<*sdbg++; cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<"\n"; }}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define cerr if(0)cout
#endif
#define next ____next
#define prev ____prev
#define left ____left
#define hash ____hash
typedef long long ll;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<pair<int, int> > VPII;
typedef vector<pair<ll, ll> > VPLL;

template<class C> void mini(C&a4, C b4){a4=min(a4, b4); }
template<class C> void maxi(C&a4, C b4){a4=max(a4, b4); }
template<class T1, class T2>
ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class A, class B, class C> struct Triple { A first; B second; C third;
  bool operator<(const Triple& t) const { if (st != t.st) return st < t.st; if (nd != t.nd) return nd < t.nd; return rd < t.rd; } };
template<class T> void ResizeVec(T&, vector<int>) {}
template<class T> void ResizeVec(vector<T>& vec, vector<int> sz) {
  vec.resize(sz[0]); sz.erase(sz.begin()); if (sz.empty()) { return; }
  for (T& v : vec) { ResizeVec(v, sz); }
}
typedef Triple<int, int, int> TIII;
template<class A, class B, class C>
ostream& operator<< (ostream &out, Triple<A, B, C> t) { return out << "(" << t.st << ", " << t.nd << ", " << t.rd << ")"; }
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }

const int N = 1e6 + 5;
int dp[N];
const int S = 3;
const int P = 1e9 + 7;
struct Matrix {
  int m[S][S];
  Matrix operator*(int p) {
    Matrix res;
    REP (i, S) {
      REP (j, S) {
        res.m[i][j] = m[i][j] * p % P;
      }
    }
    return res;
  }
  Matrix() {
    REP (i, S) {
      REP (j, S) {
        m[i][j] = 0;
      }
    }
  }
  Matrix operator*(Matrix oth) {
    Matrix res;
    REP (i, S) {
      REP (j, S) {
        REP (k, S) {
          res.m[i][j] += m[i][k] * oth.m[k][j];
        }
        res.m[i][j] %= P;
      }
    }
    return res;
  }
  Matrix operator+(Matrix oth) {
    Matrix res;
    REP (i, S) {
      REP (j, S) {
        res.m[i][j] = (m[i][j] + oth.m[i][j]) % P;
      }
    }
    return res;
  }
  Matrix operator-(Matrix oth) {
    Matrix res;
    REP (i, S) {
      REP (j, S) {
        res.m[i][j] = (m[i][j] - oth.m[i][j] + P) % P;
      }
    }
    return res;
  }
  VI operator*(VI v) {
    VI res(3);
    REP (i, S) {
      REP (j, S) {
        res[i] = (res[i] + m[i][j] * v[j]) % P;
      }
    }
    return res;
  }
  friend ostream& operator<<(ostream& out, Matrix p) {
    REP (i, S) {
      REP (j, S) {
        out<<p.m[i][j]<<",";
      }
      out<<"\n";
    }
    return out;
  }
};
Matrix Id;
Matrix pow(Matrix m, int b) {
  if (b == 0) { return Id; }
  Matrix res = m;
  b--;
  while (b) {
    if (b % 2) {
      res = res * m;
    }
    m = m * m;
    b /= 2;
  }
  return res;
}
int32_t main() {

  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(10);
  cin.tie(0);
  //double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
  
  //~ int n;
  //~ cin>>n;
  //~ dp[0] = 1;
  //~ RE (i, n) {
    //~ REP (j, i) {
      //~ dp[i] += (i - j) * (i - j) * dp[j];
    //~ }
    //~ debug(i, dp[i]);
  //~ }
  //~ FOR (c4, -10, 10) {
    //~ FOR (c3, -10, 10) {
      //~ FOR (c2, -10, 10) {
        //~ FOR (c1, -10, 10) {
          //~ bool fail = false;
          //~ FOR (i, 5, n) {
            //~ int cand = c4 * (i >= 4 ? dp[i - 4] : 0) + c3 * (i >= 3 ? dp[i - 3] : 0) + c2 * (i >= 2 ? dp[i - 2] : 0) + c1 * dp[i - 1];
            //~ if (cand != dp[i]) {
              //~ fail = true;
            //~ }
          //~ }
          //~ if (!fail) {
            //~ debug(c4, c3, c2, c1);
          //~ }
        //~ }
      //~ }
    //~ }
  //~ }
  Matrix base;
  base.m[0][0] = 4;
  base.m[0][1] = P - 2;
  base.m[0][2] = 1;
  base.m[1][0] = 1;
  base.m[2][1] = 1;
  
  int n, forb;
  cin>>n>>forb;
  vector<int> v{1, 0, 1};
  //~ Matrix m = pow(base, n - 1);
  //~ debug((m.m[0][0] * 1 + 0 * m.m[0][1] + m.m[0][2]) % P); 
  REP (i, S) {
    Id.m[i][i] = 1;
  }
  Matrix H = pow(base, 1) + Id * ((pow(base, 0) * (P - 1) * v)[0]);
  debug((pow(H, 3) * v)[0]);
  debug(H);
  int last = 0;
  Matrix cur = Id;
  VI zium(forb + 2);
  RE (i, forb) {
    int a;
    cin>>a;
    zium[i] = a;
    Matrix to_mult = (pow(base, a - last) - Id * ((pow(base, a - last - 1) * v)[0]));
    debug(to_mult);
    cur = cur * pow(base, a - last) - Id * (cur * pow(base, a - last - 1) * v)[0]; 
    //cur = (cur * to_mult);
    last = a;
  }
  debug(cur);
  cur = cur * pow(base, n - last - 1);
  VI res = cur * v;
  cout<<res[0]<<endl;
    
  
  
  //~ int V = (pow(base, 19) * v)[0] - (pow(base, 5) * v)[0] * (pow(base, 13) * v)[0];
  //~ V = ((V % P) + P) % P;
  //~ debug(V);;
  //~ debug( ((pow(base, 6) + Id * ((pow(base, 5) * (P - 1) * v)[0])) * pow(base, 13) * v)[0]);
  //~ 
  //~ int a = zium[1];
  //~ int b = zium[2] - zium[1];
  //~ int c = n - zium[2];
  //~ Matrix D = pow(base, a + b) + Id * (pow(base, a - 1) * v)[0] * (pow(base, b - 1) * v)[0];
  //~ Matrix E = Id * (pow(base, a - 1) * v)[0] * pow(base, b) + Id * (pow(base, a + b - 1) * v)[0];
  //~ Matrix X = pow(base, a);
  //~ Matrix Y = Id * (pow(base, a - 1) * v)[0];
  //~ Matrix Z = pow(base, b);
  //~ Matrix T = Id * (pow(base, b - 1) * v)[0];
  //~ Matrix M1 = X - Y;
  //~ Matrix M2 = Z - T;
  //~ Matrix M3 = pow(base, a) * pow(base, b);
  //~ debug(M1, M2, M1 * M2); 
  //~ Matrix M = (D - E);
  //~ debug((M * pow(base, c - 1) * v)[0] % P);
  //~ debug(M);
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  return 0;
}


Measured memory_bytes: 1024