#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
ll powll(ll x, ll y) {
  ll re = 1;
  for (ll i = 0; i < (ll)(y); i++) {
    re = re * x % 1000000007;
  }
  return re;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<ll> step(10001, 0);
  vector<bool> bstep(10001, true);
  for (ll i = 0; i < (ll)(m); i++) {
    int x;
    cin >> x;
    bstep[x] = false;
  }
  step[0] = 1;
  if (bstep[1] == true) {
    step[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (bstep[i] == true) {
      step[i] += step[i - 1] % 1000000007;
      step[i] += step[i - 2] % 1000000007;
    }
  }
  cout << step[n];
  return 0;
}
