#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const static ll MOD = 1e9 + 7;
int main(int argc, char *argv[]) {
  ll n, m;
  cin >> n >> m;
  vector<bool> a(n + 10);
  for (ll i = 0; i < n + 10; i++) {
    a[i] = false;
  }
  for (ll i = 0; i < m; i++) {
    ll tmp;
    cin >> tmp;
    a[tmp] = true;
  }
  vector<ll> ans(n + 10);
  if (a[1] == false) {
    ans[1] = 1;
  } else {
    ans[1] = 0;
  }
  if (a[2] == false) {
    ans[2] = ans[1] + 1;
  } else {
    ans[2] = 0;
  }
  for (int i = 3; i <= n; ++i) {
    if (a[i] == false) {
      ans[i] = ans[i - 1] + ans[i - 2];
    } else {
      ans[i] = 0;
    }
  }
  cout << ans[n] % MOD << endl;
}
