#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
const ll INF = (1LL << 60);
const int INFi = (1 << 29);
bool is_prime(ll n) {
  if (n == 1) return false;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
vll enum_divisors(ll n) {
  vll l;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      l.push_back(i);
      if (n / i != i) l.push_back(n / i);
    }
  }
  sort(l.begin(), l.end());
  return l;
}
vector<P> prime_factorize(ll n) {
  vector<P> l;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i != 0) continue;
    ll e = 0;
    while (n % i == 0) {
      e++;
      n /= i;
    }
    l.push_back({i, e});
  }
  if (n != 1) l.push_back({n, 1});
  return l;
}
int main() {
  ll n, m;
  cin >> n >> m;
  vll p(n + 1, 0);
  p[0] = 1;
  p[1] = 1;
  ll in;
  for (long long i = 0; i < (long long)(m); i++) {
    cin >> in;
    p[in] = -1;
  }
  for (long long i = (2); i < (long long)(n + 1); i++) {
    if (p[i] == -1) continue;
    p[i] =
        ((p[i - 1] == -1) ? 0 : p[i - 1]) + ((p[i - 2] == -1) ? 0 : p[i - 2]);
  }
  cout << p[n] % 1000000007 << endl;
  return 0;
}
