#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;


template <typename T>
struct Matrix
{
    using vec = std::vector<T>;
    using mat = std::vector<vec>;
    mat X;
    T MOD;

    mat mul(mat &A, mat &B, T M)
    {
        mat C(A.size(), vec(B[0].size()));
        for (unsigned i = 0; i < A.size(); i++)
            for (unsigned k = 0; k < B.size(); k++)
                for (unsigned j = 0; j < B[0].size(); j++)
                    C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % M;
        return C;
    }

    Matrix(mat &matrix, T mod) : X(matrix), MOD(mod)
    {
        for (auto &vec : X) for (auto &val : vec) val = (val % MOD + MOD) % MOD;
    }
    Matrix(mat &matrix) : X(matrix), MOD(std::numeric_limits<T>::max()) { ; }
    mat power(T n)
    {
        mat B(X.size(), vec(X.size()));
        mat C = X;
        for (unsigned i = 0; i < X.size(); i++) B[i][i] = 1;
        while (n > 0)
        {
            if (n & 1) B = mul(B, C, MOD);
            C = mul(C, C, MOD);
            n >>= 1;
        }
        return B;
    }

    vec dot(const vec &v)
    {
        vec ans(X.size());
        for (unsigned i = 0; i < X.size(); i++)
        {
            for (unsigned j = 0; j < v.size(); j++)
            {
                (ans[i] += X[i][j] * v[j]) %= MOD;
            }
        }
        return ans;
    }
};

int N, M;
vector<int> X;
constexpr lint MOD = 1000000007;

int main()
{

    vector<lint> st{1, 0, 0, 0};

    vector<vector<lint>> tr1(4), tr2(4);

    tr1[0] = {1, 1, 2, 1};
    tr1[1] = {1, 1, 2, 1};
    tr1[2] = {1, 0, 1, 1};
    tr1[3] = {1, 0, 0, 1};

    tr2[0] = {0, 0, 0, 0};
    tr2[1] = {1, 1, 2, 1};
    tr2[2] = {1, 0, 1, 1};
    tr2[3] = {1, 0, 0, 1};

    Matrix<lint> M1(tr1, MOD), M2(tr2, MOD);

    cin >> N >> M;
    X.resize(M);
    cin >> X;

    X.insert(X.begin(), 0);
    X.push_back(N);

    FOR(i, 1, X.size())
    {
        int now = X[i];
        int prev = X[i - 1];
        auto tmpmat = M1.power(now - prev - 1);
        st = Matrix<lint>(tmpmat, MOD).dot(st);
        st = M2.dot(st);
    }

    cout << st[1] << endl;
}


Measured memory_bytes: 1024