#include<bits/stdc++.h>
using namespace std;
#define MAXLOG	31
#define MAXN	100005
#define P	1000000007
long long unblock[3][3] = {{2, 2, 1}, {1, 1, 1}, {1, 0, 1}};
long long blocked[3][3] = {{1, 2, 1}, {0, 1, 1}, {0, 0, 1}};
long long now[1][3], tmp[1][3], matrix[MAXLOG][3][3];
int n, m, x[MAXN];
void Unblock(int s) {
	for (int p = 0; p < MAXLOG; p++) {
		int tnp = 1 << p;
		if (tnp & s) {
			memset(tmp, 0, sizeof(tmp));
			for (int i = 0; i <= 0; i++)
			for (int j = 0; j <= 2; j++)
			for (int k = 0; k <= 2; k++) {
				tmp[i][j] += now[i][k] * matrix[p][k][j];
				tmp[i][j] %= P;
			}
			for (int i = 0; i <= 2; i++)
				now[0][i] = tmp[0][i];
		}
	}
}
void Blocked() {
	memset(tmp, 0, sizeof(tmp));
	for (int i = 0; i <= 0; i++)
	for (int j = 0; j <= 2; j++)
	for (int k = 0; k <= 2; k++) {
		tmp[i][j] += now[i][k] * blocked[k][j];
		tmp[i][j] %= P;
	}
	for (int i = 0; i <= 2; i++)
		now[0][i] = tmp[0][i];
}
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++)
		scanf("%d", &x[i]);
	now[0][0] = 1;
	for (int i = 0; i <= 2; i++)
	for (int j = 0; j <= 2; j++)
		matrix[0][i][j] = unblock[i][j];
	for (int p = 1; p < MAXLOG; p++)
	for (int i = 0; i <= 2; i++)
	for (int j = 0; j <= 2; j++)
	for (int k = 0; k <= 2; k++) {
		matrix[p][i][j] += matrix[p - 1][i][k] * matrix[p - 1][k][j];
		matrix[p][i][j] %= P;
	}
	for (int i = 1; i <= m; i++) {
		Unblock(x[i] - x[i - 1] - 1);
		Blocked();
	}
	Unblock(n - x[m]);
	printf("%lld\n", now[0][2]);
	return 0;
}