#include <bits/stdc++.h>
using namespace std;
long long binary_search(vector<long long> a, long long n, long long key) {
  long long right = n, left = -1;
  long long md = (right + left) / 2;
  while (right - left > 1) {
    if (a[md] <= key) {
      right = md;
    } else {
      left = md;
    }
    md = (right + left) / 2;
  }
  if (left == -1) return -1;
  return right;
}
vector<long long> prime;
void Prime(long long n) {
  vector<long long> p(n, 0);
  p[0] = 1;
  p[1] = 1;
  for (long long i = 2; i < n; i++) {
    if (p[i] == 0) {
      prime.push_back(i);
      p[i] = i;
    }
    long long k = prime.size();
    for (long long j = 0; j < k && i * prime[j] < n && prime[j] <= p[i]; j++) {
      p[i * prime[j]] = prime[j];
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  int d = 10;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (i != 0) {
      d = min(d, a[i] - a[i - 1]);
    }
  }
  if (d == 1) {
    cout << 0 << endl;
    return 0;
  }
  vector<long long> cnt(n + 1, 0);
  cnt[0] = 1;
  int c = 0;
  for (int i = 0; i < n + 1; i++) {
    cnt[i] %= ((long long)1e+9 + 7);
    if (a[c] == i) {
      c++;
      continue;
    }
    if (i + 1 <= n) {
      cnt[i + 1] += cnt[i];
    }
    if (i + 2 <= n) {
      cnt[i + 2] += cnt[i];
    }
  }
  cout << cnt[n] << endl;
  return 0;
}
