#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
template <typename T, T MOD = 1000000007>
struct Mint {
  static constexpr T mod = MOD;
  T v;
  Mint() : v(0) {}
  Mint(signed v) : v(v) {}
  Mint(long long t) {
    v = t % MOD;
    if (v < 0) v += MOD;
  }
  Mint pow(long long k) {
    Mint res(1), tmp(v);
    while (k) {
      if (k & 1) res *= tmp;
      tmp *= tmp;
      k >>= 1;
    }
    return res;
  }
  static Mint add_identity() { return Mint(0); }
  static Mint mul_identity() { return Mint(1); }
  Mint inv() { return pow(MOD - 2); }
  Mint& operator+=(Mint a) {
    v += a.v;
    if (v >= MOD) v -= MOD;
    return *this;
  }
  Mint& operator-=(Mint a) {
    v += MOD - a.v;
    if (v >= MOD) v -= MOD;
    return *this;
  }
  Mint& operator*=(Mint a) {
    v = 1LL * v * a.v % MOD;
    return *this;
  }
  Mint& operator/=(Mint a) { return (*this) *= a.inv(); }
  Mint operator+(Mint a) const { return Mint(v) += a; };
  Mint operator-(Mint a) const { return Mint(v) -= a; };
  Mint operator*(Mint a) const { return Mint(v) *= a; };
  Mint operator/(Mint a) const { return Mint(v) /= a; };
  Mint operator-() const { return v ? Mint(MOD - v) : Mint(v); }
  bool operator==(const Mint a) const { return v == a.v; }
  bool operator!=(const Mint a) const { return v != a.v; }
  bool operator<(const Mint a) const { return v < a.v; }
  static T log(T a, T b) {
    const T sq = 40000;
    unordered_map<T, T> dp;
    dp.reserve(sq);
    Mint res(1);
    for (int r = 0; r < sq; r++) {
      if (!dp.count(res.v)) dp[res.v] = r;
      res *= a;
    }
    Mint p = Mint(a).inv().pow(sq);
    res = b;
    for (int q = 0; q <= MOD / sq + 1; q++) {
      if (dp.count(res.v)) {
        T idx = q * sq + dp[res.v];
        if (idx > 0) return idx;
      }
      res *= p;
    }
    assert(0);
    return T(-1);
  }
  static Mint comb(long long n, int k) {
    Mint num(1), dom(1);
    for (int i = 0; i < k; i++) {
      num *= Mint(n - i);
      dom *= Mint(i + 1);
    }
    return num / dom;
  }
};
template <typename T, T MOD>
constexpr T Mint<T, MOD>::mod;
signed main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<int> used(n + 1, 0);
  for (int x : a) used[x] = 1;
  using M = Mint<int>;
  vector<M> dp(n + 1, 0);
  dp[0] = M(1);
  for (int i = 0; i < n; i++) {
    if (used[i]) dp[i] = M(0);
    dp[i + 1] += dp[i];
    dp[i + 2] += dp[i];
  }
  cout << dp[n].v << endl;
  return 0;
}
