#include <bits/stdc++.h>

using namespace std;

#define sqr(x) ((x) * (x))
#define pb push_back
#define mp make_pair
#define ins insert
#define er erase
#define bg begin()
#define ed end()
#define f first
#define s second
#define fin(name) freopen(name, "r", stdin)
#define fout(name) freopen(name, "w", stdout)
#define files(name) fin(name".in"); fout(name".out")
#define enter cout << "\n"
#define space cout << " "
#define endl "\n"
#define fi(st,n) for (int i = (st); i <= (n); ++i)
#define fj(st,n) for (int j = (st); j <= (n); ++j)
#define fk(st,n) for (int k = (st); k <= (n); ++k)
#define fq(st,n) for (int q = (st); q <= (n); ++q)
#define fw(st,n) for (int w = (st); w <= (n); ++w)
#define ff(i, st, n) for (int (i) = (st); (i) <= (n); ++(i))
#define ei(st,n) for (int i = (st); i >= (n); --i)
#define ej(st,n) for (int j = (st); j >= (n); --j)
#define ek(st,n) for (int k = (st); k >= (n); --k)
#define ef(i, st, n) for (int (i) = (st); (i) >= (n); --(i))
#define ri(st,n) for (int i = (st); i < (n); ++i)
#define rj(st,n) for (int j = (st); j < (n); ++j)
#define rk(st,n) for (int k = (st); k < (n); ++k)
#define rq(st,n) for (int q = (st); q < (n); ++q)
#define rf(i, st, n) for (int (i) = (st); (i) < (n); ++(i))
#define clean(a) memset((a),0,sizeof (a))
#define sync ios_base::sync_with_stdio(0);cin.tie(0)
#define y1 dsklmlvmd

typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int inf = (int)1e9;
const dbl eps = (dbl) 1e-8;
const int mod = (int) 1e9 + 7;
const int maxn = (int) 1e5 + 5;
//const dbl M_PI = (dbl)2 * (dbl)acos(0);

//cout<<fixed<<setprecision(10);
//srand(time(0));

const int K = 4;

void init_mat(int ** &a) {
    a = new int *[4];
    ri(0, K) {
        a[i] = new int[4];
        rj(0, K) {
            a[i][j] = 0;
        }
    }
}

void print(int ** a);

int ** multi(int ** &a, int ** b) {
    static int a0[4][4];
    static int b0[4][4];
    ri(0, K) {
        rj(0, K) {
            a0[i][j] = a[i][j];
            b0[i][j] = b[i][j];
        }
    }
    ri(0, K) {
        rj(0, K) {
            a[i][j] = 0;
            rk(0, K) {
                a[i][j] = (a[i][j] + (ll)a0[i][k] * (ll)b0[k][j]) % mod;
            }
        }
    }
    return a;
}

int **d0;
int **d1;

int ** step(int st) {
    int ** a;
    if (st == 0) {
        init_mat(a);
        ri(0, K)
            a[i][i] = 1;
        return a;
    }
    if (st & 1) {
        a = step(st - 1);
        multi(a, d0);
    } else {
        a = step(st / 2);
        multi(a, a);
    }
    return a;
}

void print(int ** a) {
    ri(0, K) {
        rj(0, K) {
            cout << a[i][j] << " ";
        }
        cout << endl;
    }
}

int n, m, a[maxn];

int main() {
//    fin("t.in");
    sync;
    cin >> n >> m;
    fi(1, m) {
        cin >> a[i];
    }
    int **ans;
    init_mat(ans);
    init_mat(d0);
    init_mat(d1);

    d0[0][0] = 1;
    d0[0][3] = 1;
    d0[1][0] = 1;
    d0[1][1] = 1;
    d0[1][3] = 1;
    d0[2][0] = 1;
    d0[2][2] = 1;
    d0[2][3] = 1;
    d0[3][0] = 1;
    d0[3][1] = 1;
    d0[3][2] = 1;
    d0[3][3] = 2;

    d1[0][0] = 1;
    d1[1][0] = 1;
    d1[1][1] = 1;
    d1[2][0] = 1;
    d1[2][2] = 1;
    d1[3][0] = 1;
    d1[3][1] = 1;
    d1[3][2] = 1;
    d1[3][3] = 1;

    ri(0, K) {
        rj(0, K) {
            ans[i][j] = (i == j);
        }
    }

    int u = 0;

    ++m;
    a[m] = n + 1;
    fi(1, n) {
        if (u + 1 <= m && a[u + 1] == i) {
            multi(ans, d1);
            ++u;
        } else {
            multi(ans, step(a[u + 1] - i));
            i = a[u + 1] - 1;
        }
    }

    cout << ans[3][0] << endl;
    return 0;
}

Measured memory_bytes: 17792