#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(v) v.begin(),v.end()

const int maxn = 1e5 + 100;
const ll inf = 2e18, mod = 1e9 + 7;

struct Matrix {
	int n, m;
	ll val[10][10];

	Matrix(int N, int M) {
		n = N;
		m = M;
		memset(val, 0, sizeof(val));
	}

	ll* operator[](int x) {
		return val[x];
	}	
};

Matrix operator*(Matrix a, Matrix b) {
	Matrix c(a.n, b.m);
	for (int i = 0; i < a.n; i++) {
		for (int j = 0; j < b.m; j++) {
			for (int k = 0; k < a.m; k++) {
				c[i][j] = (c[i][j] + a[i][k] * b[k][j] % mod) % mod;
			}
		}
	}

	return c;
}

Matrix pow(Matrix a, ll b) {
	Matrix res(a.n, a.m);
	for (int i = 0; i < a.n; i++) {
		res[i][i] = 1;
	}

	for (int i = 60; i >= 0; i--) {
		res = res * res;
		if ((b >> i) & 1) {
			res = res * a;
		}
	}

	return res;
}

int n, m, a[maxn];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	Matrix updater(4, 4);
	Matrix spUpdater(4, 4);
	for (int i = 0; i < 4; i++) {
		updater[i][i] = updater[i][0] = updater[3][i] = 1;
		spUpdater[i][i] = spUpdater[i][0] = spUpdater[3][i] = 1;
	}
	for (int i = 0; i < 4; i++) {
		updater[i][3]++;
	}
	
	Matrix dp(4, 1);
	for (int i = 0; i < 4; i++) {
		dp[i][0] = 1;
	}

	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}

	int pos = 1;
	for (int i = 0; i < m; i++) {
		Matrix tmp = pow(updater, a[i] - pos);
		tmp = spUpdater * tmp;
		dp = tmp * dp;
		pos = a[i] + 1;
	}
	if (pos < n) {
		dp = pow(updater, n - pos) * dp;
	}
	cout << dp[3][0] << endl;
}

