#include <bits/stdc++.h> 
using namespace std; 
int gi() { 
	int res = 0, w = 1; 
	char ch = getchar(); 
	while (ch != '-' && !isdigit(ch)) ch = getchar(); 
	if (ch == '-') w = -1, ch = getchar(); 
	while (isdigit(ch)) res = res * 10 + ch - '0', ch = getchar(); 
	return res * w; 
} 
const int Mod = 1e9 + 7; 
struct Matrix { 
	int m[3][3]; 
	Matrix () { memset(m, 0, sizeof(m)); } 
	int *operator [] (const int &id) { return m[id]; } 
	Matrix operator * (const Matrix &r) const { 
		Matrix res; 
		for (int i = 0; i < 3; i++)
			for (int k = 0; k < 3; k++) { 
				if (!m[i][k]) continue; 
				for (int j = 0; j < 3; j++) 
					res[i][j] = (res[i][j] + 1ll * m[i][k] * r.m[k][j]) % Mod; 
			} 
		return res; 
	} 
} F, G[30], H; 
int N, M; 
int main () { 
#ifndef ONLINE_JUDGE 
    freopen("cpp.in", "r", stdin); 
#endif 
	G[0][0][0] = 1, G[0][0][1] = 2, G[0][0][2] = 1; 
	G[0][1][0] = 0, G[0][1][1] = 1, G[0][1][2] = 1; 
	G[0][2][0] = 1, G[0][2][1] = 2, G[0][2][2] = 2; 
	H = G[0]; 
	H[2][0] = H[2][1] = 0, H[2][2] = 1; 
	for (int i = 1; i <= 29; i++) G[i] = G[i - 1] * G[i - 1]; 
	F[0][0] = 1; 
	N = gi(), M = gi(); 
	int pos = -1; 
	for (int i = 1; i <= M; i++) { 
		int x = gi(); 
		for (int j = 0; j < 30; j++) 
			if ((x - pos - 1) >> j & 1) F = F * G[j]; 
		F = F * H; 
		pos = x; 
	} 
	for (int j = 0; j < 30; j++) 
		if ((N - pos - 1) >> j & 1) F = F * G[j]; 
	printf("%d\n", F[0][2]); 
    return 0; 
} 