#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) { return x == 0 ? 1 : log10(x) + 1; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.push_back({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.push_back({n, 1});
  }
  return result;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  ll N, M;
  cin >> N >> M;
  map<ll, ll> m;
  for (ll i = 0; i < (ll)(M); ++i) {
    ll a;
    cin >> a;
    m[a] = 1;
  }
  vll dp(N + 1);
  for (ll i = 0; i < (ll)(N + 1); ++i) {
    dp[i] = INF;
  }
  for (ll i = 0; i < (ll)(N + 1); ++i) {
    if (m[i] == 1) {
      dp[i] = 0;
      continue;
    }
    if (i == 0) {
      dp[i] = 1;
      continue;
    }
    if (i == 1) {
      dp[i] = dp[i - 1];
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  ll ans = dp[N] % 1000000007;
  cout << (ans) << endl;
  return 0;
}
