#include <bits/stdc++.h>
using namespace std;
void showIntArray(long long a[], long long n);
long long func(int start, int end) {
  if (end - start == 1)
    return 1;
  else if (end - start == 2)
    return 2;
  else
    return 3 + func(start, end - 1) + func(start, end - 2);
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < M; i++) {
    if (a[i] - a[i - 1] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  long long result = func(0, a[0] - 1);
  for (int i = 1; i < M; i++) {
    result += func(a[i - 1] + 1, a[i] - 1);
  }
  result += func(a[M - 1] + 1, N);
  cout << result % 1000000007 << endl;
  return 0;
}
void showIntArray(long long a[], long long n) {
  for (int i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
  cout << endl;
}
