#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

ll mod_pow(ll x, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % mod;
		x = x * x % mod; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

typedef modint Data;
typedef vector<Data> Array;
typedef vector<Array> mat;

mat operator-(mat a) {
	rep(i, a.size())rep(j, a[0].size())a[i][j] = -a[i][j];
	return a;
}
mat operator+(mat lhs, mat& rhs) {
	rep(i, lhs.size())rep(j, lhs[0].size())lhs[i][j] += rhs[i][j];
	return lhs;
}
mat operator-(mat lhs, mat& rhs) {
	rep(i, lhs.size())rep(j, lhs[0].size())lhs[i][j] -= rhs[i][j];
	return lhs;
}
mat operator*(const mat& lhs, const mat& rhs) {
	mat ret(lhs.size(), Array(rhs[0].size(), 0));
	rep(i, lhs.size())rep(j, rhs[0].size())rep(k, rhs.size()) {
		ret[i][j] +=lhs[i][k]*rhs[k][j];
	}
	return ret;
}
//no verify
int rankMat(mat a) {
	const int n = a.size(), m = a[0].size();
	int r = 0;
	for (int i = 0; r < n && i < m; ++i) {
		int pivot = r;
		for (int j = r + 1; j < n; ++j)
			if (abs(a[j][i]) > abs(a[pivot][i]))pivot = j;
		swap(a[pivot], a[r]);
		if (a[r][i]==(modint)0)continue;
		for (int k = m - 1; k >= i; --k)
			a[r][k] = a[r][k] / a[r][i];
		for (int j = r + 1; j < n; ++j) {
			for (int k = m - 1; k >= i; --k) {
				a[j][k] += (modint)-a[r][k]*a[j][i];
			}
		}
		++r;
	}
	return r;
}
mat scalar(int sz, Data k) {
	mat ret(sz, Array(sz, 0));
	rep(i, sz)ret[i][i] = k;
	return ret;
}
//行列累乗
mat operator^(const mat& lhs, const ll n) {
	if (n == 0)return scalar(lhs.size(), 1);
	mat ret = (lhs * lhs) ^ (n / 2);
	if (n % 2) {
		ret = ret * lhs;
	}
	return ret;
}

Data det(mat a) {
	const int n = a.size();
	Data D = Data(1);
	for (int i = 0; i < n; ++i) {
		int pivot = i;
		for (int j = i + 1; j < n; ++j) {
			if (abs(a[j][i]) > abs(a[pivot][i]))pivot = j;
		}
		swap(a[pivot], a[i]);
		D = D * a[i][i] * Data(i != pivot ? -1 : 1);
		if (a[i][i]==(modint)0)break;
		for (int j = i + 1; j < n; ++j) {
			for (int k = n - 1; k >= i; --k) {
				a[j][k] = a[j][k] - a[i][k] * a[j][i] / a[i][i];
			}
		}
	}
	return D;
}
Array multi(mat A, Array b) {
	int n = A.size();
	int m = A[0].size();
	vector<modint> res(n);
	rep(i, n) {
		rep(j, m) {
			res[i] += A[i][j] * b[j];
		}
	}
	return res;
}

mat A = {
	{3,-1,2,2},
	{1,0,0,0},
	{1,0,1,0},
	{0,0,0,1}
};
void solve() {
	int n, m; cin >> n >> m;
	vector<int> x(m);
	rep(i, m) {
		cin >> x[i];
	}

	int cur = 0;
	Array b = { 1,0,0,1 };
	rep(i, m) {
		int num = x[i] - cur;
		mat B = A ^ num;
		b = multi(B, b);
		modint memo = b[1];
		b = multi(A, b);
		b[2] -= (modint)2*memo;
		b[1] -= memo;
		b[0] -= (modint)5 * memo;
		cur = x[i] + 1;
		//cout << "! "<<cur<<" "<<b[0] << " " << b[1] << " " << b[2] <<" "<<b[3] <<"\n";
	}
	int num = n - cur;
	mat B = A ^ num;
	b = multi(B, b);
	modint ans = b[1];
	cout << ans << "\n";
}




signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	//int t; cin >> t; rep(i, t)
	solve();
	return 0;
}


Measured memory_bytes: 20088