#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  int t = 0;
  vector<int> b(n + 1, 0);
  for (int cur = 0; cur <= n; cur++) {
    if (a.size() != 0 and a[t] == cur) {
      t++;
      continue;
    }
    if (a.size() == 0 or a[t] != cur + 1) {
      if (cur == 0) b[cur + 1] = 1;
      if (b[cur] != 0) {
        b[cur + 1] += b[cur];
        b[cur + 1] %= MOD;
      }
    }
    if (a.size() == 0 or a[t] != cur + 2) {
      if (cur == 0) b[cur + 2] = 1;
      if (b[cur] != 0) {
        b[cur + 2] += b[cur];
        b[cur + 2] %= MOD;
      }
    }
  }
  b[n] %= MOD;
  cout << b[n] << endl;
  return 0;
}
