#include <bits/stdc++.h>

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define SIZE(c) (int) (c).size()
#define FORE(i,c) FOR(i,0,SIZE(c)-1)
#define FORDE(i,c) FORD(i,SIZE(c)-1,0)

#define pb push_back
#define mp make_pair
#define st first
#define nd second


using namespace std;

typedef long long ll;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;

typedef vector <int> VI;
typedef vector <bool> VB;
typedef vector <pii> VP;
typedef vector <ll> VL;
typedef vector <pll> VPL;

typedef vector <VI> VVI;
typedef vector <VL> VVL;
typedef vector <VB> VVB;
typedef vector <VP> VVP;

const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000000000000001LL;

typedef VVL Matrix;
typedef VL Vector;

Matrix zero(int n, int m) {
    Matrix ans(n);
    FORE(i,ans) ans[i].resize(m,0);

    return ans;
}

Matrix identity(int n) {
    Matrix ans = zero(n, n);
    FOR(i,0,n-1) ans[i][i] = 1;

    return ans;
}

Matrix operator *(const Matrix &a, const Matrix &b) {
    int n = SIZE(a),
        k = SIZE(a[0]),
        m = SIZE(b[0]);

    Matrix ans = zero(n, m);

    FOR(i,0,n-1) FOR(j,0,k-1) FOR(t,0,m-1) {
        ans[i][t] = (ans[i][t] + a[i][j] * b[j][t]) % MOD;
    }

    return ans;
}

Vector operator *(const Matrix &a, const Vector &b) {
    int n = SIZE(a),
        m = SIZE(b);

    Vector ans(n,0);

    FOR(i,0,n-1) FOR(j,0,m-1) {
        ans[i] = (ans[i] + a[i][j] * b[j]) % MOD;
    }

    return ans;
}

Matrix expo(const Matrix &a, int exp) {
    int n = SIZE(a);

    if (!exp) {
        return identity(n);
    } else {
        Matrix temp = expo(a, exp / 2);
        temp = temp * temp;

        if (exp%2) {
            temp = temp * a;
        }

        return temp;
    }
}

Matrix operator +(const Matrix &a, const Matrix &b) {
    Matrix ans = a;

    FORE(i,ans) FORE(j,ans[i])
        ans[i][j] = (ans[i][j] + b[i][j]) % MOD;

    return ans;
}

Matrix operator -(const Matrix &a, const Matrix &b) {
    Matrix ans = a;

    FORE(i,ans) FORE(j,ans[i])
        ans[i][j] = (ans[i][j] + MOD - b[i][j]) % MOD;

    return ans;
}

Matrix M = {
    {1, 2, 1},
    {0, 1, 1},
    {1, 2, 2}
};

/*************************************************************************/

int main() {
    ios_base::sync_with_stdio(0);
    
    int n, m;
    cin >> n >> m;
    
    VI x(m+1);
    x[m] = n;
    
    FOR(i,0,m-1) {
        cin >> x[i];
    }
    
    set <int> pts, xs;
    FOR(i,0,m-1) {
        pts.insert(x[i] - 1);
        pts.insert(x[i] + 1);
    }
    
    FOR(i,0,m-1) {
        pts.erase(x[i]);
        xs.insert(x[i]);
    }
    
    pts.insert(n);
    
    Vector vec = {0, 0, 1};
    
    int last = 0;
    for (int pos : pts) {
        Matrix trans;
        ll len = pos - last;
        
        if (xs.count(pos-1)) {
            trans = {
                {1, 2 * len, (len * len) % MOD},
                {0, 1, len},
                {1, 2 * len, (len * len + 1) % MOD}
            };
        } else {
            trans = expo(M, len);
        }
        
        vec = trans * vec;
        last = pos;
    }
    
    cout << vec[0];

    return 0;
}

/*************************************************************************/


Measured memory_bytes: 14720