#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (auto &e : a) cin >> e;
  vector<int> p(n + 1, 0);
  p[0] = 1;
  auto t = a.begin();
  if (m == 0 or a[0] != 1) {
    p[1] = 1;
  } else {
    t++;
  }
  for (int i = 2; i < n + 1; i++) {
    if (*t == i) {
      p[i] = 0;
      t++;
    } else {
      p[i] = (p[i - 1] + p[i - 2]) % 1000000007;
    }
  }
  cout << p[n] << endl;
}
