#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; (i < M); ++i) {
    cin >> a[i];
  }
  vector<long long> count(M + 1);
  long long curr = 0;
  for (long long i = 0; (i < M); ++i) {
    count[i] = a[i] - curr;
    curr = a[i] + 1;
  }
  count[M] = N + 1 - curr;
  sort(count.begin(), count.end());
  if (count[0] <= 0) {
    cout << 0 << endl;
    return 0;
  }
  vector<long long> zero(count[M] + 5), one(count[M] + 5);
  zero[0] = 1;
  one[0] = 0;
  zero[1] = 1;
  one[1] = 1;
  for (long long i = 2; (i < count[M] + 5); ++i) {
    zero[i] = one[i - 1];
    one[i] = one[i - 1] + zero[i - 1];
  }
  long long cnt = count[0] - 2;
  if (cnt < 0) cnt = 0;
  long long result = zero[cnt] + one[cnt];
  for (long long i = 1; (i < M + 1); ++i) {
    cnt = count[i] - 2;
    if (cnt < 0) cnt = 0;
    result = result * (zero[cnt] + one[cnt]);
    result %= 1000000007;
  }
  cout << result << endl;
  return 0;
}
