#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct matrix {
        using mat = vector<vector<T>>;
        inline mat create(int n, int m) {
                return vector<vector<T>>(n, vector<T>(m, T(0)));
        }
        inline mat create(int n) {
                return create(n, n);
        }
        mat identity(int n) {
                mat r = create(n);
                for (int i = 0; i < n; i++)
                        r[i][i] = 1;
                return r;
        }
        mat mul(mat a, mat b) {
                if (a.empty() || b.empty())
                        throw;
                int an = a.size(), am = a[0].size();
                int bn = b.size(), bm = a[0].size();
                if (am != bn)
                        throw;
                mat r = create(an, bm);
                for (int i = 0; i < an; i++) {
                        for (int j = 0; j < bm; j++) {
                                T s = T(0);
                                for (int k = 0; k < am; k++) {
                                        s += a[i][k] * b[k][j];
                                }
                                r[i][j] = s;
                        }
                }
                return r;
        }
        mat pwr(mat a, long long b) {
                if (a.empty())
                        throw;
                int an = a.size(), am = a[0].size();
                if (an != am)
                        throw;
                mat r = identity(an);
                for (; b; b >>= 1, a = mul(a, a))
                        if (b & 1)
                                r = mul(r, a);
                return r;
        }
};
template<long long mod = 1000000007ll > class umod_t{
private:
    long long number;
public:
    umod_t(): number(0ll){}
    umod_t(long long value){ value %= mod; if(value < 0) value += mod; number = value; }
    umod_t & operator += (umod_t other){ number += other.number; if(number >= mod) number -= mod; return * this; }
    umod_t & operator -= (umod_t other){ number -= other.number; if(number < 0) number += mod; return * this; }
    umod_t & operator *= (umod_t other){ number = number * other.number % mod; return * this; }
    umod_t & operator /= (umod_t other){ return * this *= other.inverse(); }
    umod_t operator + (umod_t other) const { return umod_t(*this) += other; }
    umod_t operator - (umod_t other) const { return umod_t(*this) -= other; }
    umod_t operator * (umod_t other) const { return umod_t(*this) *= other; }
    umod_t operator / (umod_t other) const { return umod_t(*this) /= other; }
    bool operator < (umod_t other) const { return number < other.number; }
    bool operator > (umod_t other) const { return number > other.number; }
    bool operator <= (umod_t other) const { return number <= other.number; }
    bool operator >= (umod_t other) const { return number >= other.number; }
    bool operator == (umod_t other) const { return number == other.number; }
    bool operator != (umod_t other) const { return number != other.number; }
    umod_t inverse() const {
        long long a = number, b = mod, u = 1, v = 0;
        while(b){
            long long t = a/b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        if(u < 0)
            u += mod;
        return u;
    }
    long long getNumber(){
        return number;
    }
};
using U = umod_t<>;
using mat = matrix<U>::mat;
matrix<U> M;
int main(){
	mat bd = {
		{2, 2, 1},
		{1, 1, 1},
		{1, 0, 1},
	};
	mat sd = {
		{1, 2, 1},
		{0, 1, 1},
		{0, 0, 1},
	};
	mat fd = {
		{1, 0, 0},
		{1, 0, 0},
		{1, 0, 0},
	};
	int n, m, last = 0;
	cin >> n >> m;
	mat res = M.identity(3); 
	for(int i = 0; i < m; i++){
		int x; cin >> x;
		int sz = (x - last);
		last = x;
		res = M.mul(res, M.pwr(bd, sz - 1));
		res = M.mul(res, sd);
	}
	int sz = (n - last);
	res = M.mul(res, M.pwr(bd, sz - 1));
	res = M.mul(res, fd);
	cout << res[0][0].getNumber() << endl;
	return 0;
}


Measured memory_bytes: 256