#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a), i##_end_ = (b); i <= i##_end_; ++i)
#define drep(i, a, b) for(int i = (a), i##_end_ = (b); i >= i##_end_; --i)
#define clar(a, b) memset((a), (b), sizeof(a))
#define debug(...) fprintf(stderr, __VA_ARGS__)
typedef long long LL;
typedef long double LD;
int read() {
    char ch = getchar();
    int x = 0, flag = 1;
    for (;!isdigit(ch); ch = getchar()) if (ch == '-') flag *= -1;
    for (;isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
    return x * flag;
}
void write(int x) {
    if (x < 0) putchar('-'), x = -x;
    if (x >= 10) write(x / 10);
    putchar(x % 10 + 48);
}

const int Maxn = 1000009, Mod = 1e9 + 7;

struct matrix {
	int a[3][3];
	matrix(int flag = 0) {
		if (flag == 1) 
			rep (i, 0, 2)
				rep (j, 0, 2) a[i][j] = (i == j);
		if (flag == 0) 
			rep (i, 0, 2)
				rep (j, 0, 2) a[i][j] = 0;
	}
	matrix operator * (const matrix &b) const {
		matrix c(0);
			rep (i, 0, 2)
				rep (j, 0, 2)
					rep (k, 0, 2)
					(c.a[i][j] += 1ll * a[i][k] * b.a[k][j] % Mod) %= Mod;
		return c;
	}
};

matrix fpm(matrix base, int tims) {
	matrix r(1);
	while (tims) {
		if (tims & 1) r = r * base;
		base = base * base;
		tims >>= 1;
	}
	return r;
}

matrix Ans, f1, f2;
int n, m, a[Maxn];

void init() {
	n = read(), m = read();
	rep (i, 1, m) a[i] = read(); 
	a[++m] = n; a[++m] = 0;
	sort(a + 1, a + m + 1);
}

void solve() {
	Ans.a[0][0] = 1; Ans.a[0][1] = 0; Ans.a[0][2] = 0;
	Ans.a[1][0] = 0; Ans.a[1][1] = 1; Ans.a[1][2] = 0;
	Ans.a[2][0] = 0; Ans.a[2][1] = 0; Ans.a[2][2] = 1;
	f1.a[0][0] = 1; f1.a[0][1] = 0; f1.a[0][2] = 1;
	f1.a[1][0] = 2; f1.a[1][1] = 1; f1.a[1][2] = 2;
	f1.a[2][0] = 1; f1.a[2][1] = 1; f1.a[2][2] = 2;
	f2.a[0][0] = 1; f2.a[0][1] = 0; f2.a[0][2] = 0;
	f2.a[1][0] = 2; f2.a[1][1] = 1; f2.a[1][2] = 0;
	f2.a[2][0] = 1; f2.a[2][1] = 1; f2.a[2][2] = 1;
	int now = 0; // dp a[i] - now times
	rep (i, 1, m) {
		Ans = fpm(f1, a[i] - now) * Ans;
		if (i == m) break;
		Ans = f2 * Ans; now = a[i] + 1;
	}
	printf("%d\n", Ans.a[2][0]);
}

int main() {
//	freopen("E.in", "r", stdin);
//	freopen("E.out", "w", stdout);

	init();
	solve();

#ifdef Qrsikno
    debug("\nRunning time: %.3lf(s)\n", clock() * 1.0 / CLOCKS_PER_SEC);
#endif
    return 0;
}

