#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>

using namespace std;
const int mod = 1e9 + 7;
class Matrix{
public:
	int m[3][3];
	Matrix () {memset(m , 0 , sizeof m);}
};

Matrix mul(const Matrix m1 , const Matrix m2){
	Matrix ret;
	for(int k = 0 ; k < 3 ; ++ k)
		for(int i = 0 ; i < 3 ; ++ i){
			int d = m1.m[i][k];
			for(int j = 0 ; j < 3 ; ++ j)
				ret.m[i][j] = (ret.m[i][j] + 1ll * d * m2.m[k][j]) % mod;
		}
	return ret;
}

const int maxn = 1e5 + 10;
int imp[maxn] , n , m;

Matrix tran1 , tran2 , st , tran , O;
void init(){
	tran1.m[0][0] = tran1.m[2][0] = 1;
	tran1.m[0][1] = tran1.m[1][1] = tran1.m[2][1] = 1;
	tran1.m[0][2] = 1;
	tran1.m[1][2] = tran1.m[2][2] = 2;
	tran2 = tran1;
	for(int i = 0 ; i < 3 ; ++ i)
		tran2.m[2][i] --; 
	st.m[0][0] = 1;
	for(int i = 0 ; i < 3 ; ++ i)
		O.m[i][i] = 1;
}

Matrix pw(Matrix t , int c){
	Matrix ret = O;
	while(c){
		if(c & 1)
			ret = mul(ret , t);
		t = mul(t , t);
		c >>= 1;
	}
	return ret;
}

int main(){
	ios::sync_with_stdio(0);
	cin >> n >> m;
	for(int i = 1 ; i <= m ; ++ i)
		cin >> imp[i];
	int last = 0;
	init();
	imp[0] = -1;
	for(int i = 1 ; i <= m ; ++ i){
		if(imp[i] != last){
			tran = tran1;
			st = mul(st , pw(tran , imp[i] - last));
		}
		last = imp[i] + 1;
		st = mul(st , tran2);
	}
	if(last != n){
		tran = tran1;
		st = mul(st , pw(tran , n - imp[m] - 1));
	}
	cout << st.m[0][2] << endl;
	return 0;
}