#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int N, M;
  vector<long long int> a;
  cin >> N >> M;
  a.resize(M + 1);
  a[0] = 1000000;
  for (int i = 1; i < M + 1; i++) {
    cin >> a[i];
    if (a[i - 1] + 1 == a[i]) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long int> S;
  S.resize(N + 5);
  S[1] = 1;
  S[2] = 2;
  for (int i = 1; i <= N; i++) {
    S[i + 2] = S[i + 1] + S[i];
  }
  long long int ans = 1;
  for (int i = 1; i < M + 1; i++) {
    if (i == 1) {
      if (a[i] == 1)
        ans += 0;
      else
        ans += S[a[i] - 1];
    } else {
      ans *= S[(a[i] - 1) - (a[i - 1] + 1)];
    }
  }
  ans *= S[N - (a[M] + 1)];
  ans = ans - 1;
  cout << ans % 1000000007 << endl;
}
