#include <cstdio>
#include <cstdlib>

using namespace std;

const int mod = 1000000007;
const long long mod2 = (long long)mod * mod;

class Matrix {
    public:
    
    int n;
    int m;
    int *data;
    
    Matrix(int n, int m) {
        this->n = n;
        this->m = m;
        data = (int *)calloc(n * m, sizeof(int));
    }
    
    Matrix(const Matrix &a) {
        n = a.n;
        m = a.m;
        data = (int *)malloc(sizeof(int) * n * m);
        
        for (int i = 0; i < n * m; i++) data[i] = a.data[i];
    }
    
    ~Matrix() {
        free(data);
    }
    
    Matrix& operator=(const Matrix &a) {
        free(data);
        
        n = a.n;
        m = a.m;
        data = (int *)malloc(sizeof(int) * n * m);
        
        for (int i = 0; i < n * m; i++) data[i] = a.data[i];
        
        return *this;
    }
    
    int* operator[](int x) {
        return data + x * m;
    }
    
    void identify(void) {
        for (int i = 0, j = 0; i < n; i++, j += m + 1) data[j] = 1;
    }
    
    const Matrix operator*(const Matrix &a) const {
        int *tmp = (int *)malloc(sizeof(int) * a.n * a.m);
        Matrix ans(n, a.m);
        
        for (int i = 0; i < a.m; i++) {
            for (int j = 0; j < a.n; j++) {
                tmp[i * a.n + j] = a.data[j * a.m + i];
            }
        }
        
        for (int i = 0, l = 0; i < n; i++) {
            int *p1 = data + i * m;
            int *p2 = tmp;
            
            for (int j = 0; j < a.m; j++, l++, p2 += m) {
                int *pa = p1;
                int *pb = p2;
                long long sum = 0;
                
                for (int k = 0; k < m; k++, pa++, pb++) {
                    sum += (long long)*pa * *pb;
                    if (sum >= mod2) sum -= mod2;
                }
                
                ans.data[l] = sum % mod;
            }
        }
        
        free(tmp);
        
        return ans;
    }
    
    void operator*=(const Matrix &a) {
        int *tmp = (int *)malloc(sizeof(int) * n * n);
        int *ans = (int *)malloc(sizeof(int) * n * n);
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                tmp[i * n + j] = a.data[j * n + i];
            }
        }
        
        for (int i = 0, l = 0; i < n; i++) {
            int *p1 = data + i * n;
            int *p2 = tmp;
            
            for (int j = 0; j < n; j++, l++, p2 += n) {
                int *pa = p1;
                int *pb = p2;
                long long sum = 0;
                
                for (int k = 0; k < n; k++, pa++, pb++) {
                    sum += (long long)*pa * *pb;
                    if (sum >= mod2) sum -= mod2;
                }
                
                ans[l] = sum % mod;
            }
        }
        
        for (int i = 0; i < n * n; i++) data[i] = ans[i];
        
        free(tmp);
        free(ans);
    }
    
    const Matrix operator^(long long x) const {
        Matrix a = *this;
        Matrix ans(n, m);
        
        ans.identify();
        
        while (x) {
            if (x & 1) ans *= a;
            a *= a;
            x >>= 1;
        }
        
        return ans;
    }
};

int x[100001];

int main() {
    int n, m, i;
    Matrix a(3, 3), b(3, 3), c(3, 3);
    
    scanf("%d %d", &n, &m);
    
    x[0] = 0;
    for (i = 1; i <= m; i++) scanf("%d", &x[i]);
    
    a[0][0] = 2;
    a[0][1] = 2;
    a[0][2] = 1;
    a[1][0] = 1;
    a[1][1] = 1;
    a[1][2] = 1;
    a[2][0] = 1;
    a[2][1] = 0;
    a[2][2] = 1;
    
    b[0][0] = 1;
    b[0][1] = 2;
    b[0][2] = 1;
    b[1][0] = 0;
    b[1][1] = 1;
    b[1][2] = 1;
    b[2][0] = 0;
    b[2][1] = 0;
    b[2][2] = 1;
    
    c.identify();
    
    for (i = 1; i <= m; i++) {
        c *= a ^ (x[i] - x[i - 1] - 1);
        c *= b;
    }
    
    c *= a ^ (n - x[m] - 1);
    
    printf("%lld\n", ((long long)c[0][0] + c[0][1] + c[0][2]) % mod);
    
    return 0;
}


Measured memory_bytes: 640