#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x = 0) : x(x % mod){};
  mint pow(ll y) const {
    mint res(1);
    mint a(x);
    while (y > 0) {
      if (y & 1) res *= a;
      a *= a;
      y >>= 1;
    }
    return res;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator+=(const mint a) noexcept {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) noexcept {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) noexcept {
    (x *= a.x) %= mod;
    return *this;
  }
  mint& operator/=(const mint a) noexcept { return (*this) *= a.inv(); }
  mint operator+(const mint a) const noexcept {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const noexcept {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const noexcept {
    mint res(*this);
    return res *= a;
  }
  mint operator/(const mint a) const noexcept {
    mint res(*this);
    return res /= a;
  }
};
mint modncm(ll n, ll m) {
  mint a = 1, b = 1;
  for (int i = (0); i < (m); i++) a *= mint(n - i), b *= (m - i);
  return a * b.inv();
}
int main(void) {
  int n, m;
  cin >> n >> m;
  map<int, int> mp;
  for (int i = (0); i < (m); i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  vector<mint> dp(n + 2, 0);
  dp[0] = 1;
  for (int i = (0); i < (n + 1); i++) {
    for (int j = (0); j < (2); j++) {
      int ni = i + j + 1;
      if (!mp[ni]) dp[ni] += dp[i];
    }
  }
  cout << dp[n].x << endl;
  return 0;
}
