#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m, ans;
  cin >> n >> m;
  vector<ll> a(m);
  vector<ll> p(n + 1);
  vector<ll> pa(n + 1);
  for (ll i = 0; i < n + 1; i++) {
    p.at(i) = i;
    pa.at(i) = i;
  }
  p.at(0) = 1;
  pa.at(0) = 1;
  for (ll i = 0; i < m; i++) {
    cin >> a.at(i);
  }
  for (ll i = 0; i < m; i++) {
    p.at(a.at(i)) = 0;
  }
  for (ll i = 0; i < n + 1; i++) {
    if (i >= 2) {
      pa.at(i) = pa.at(i - 1) + pa.at(i - 2);
    }
    if (p.at(i) == 0) {
      pa.at(i) = 0;
    }
  }
  ans = pa.at(n) % 1000000007;
  cout << ans << endl;
}
