#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
struct mint {
  long long int x;
  mint(long long int x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(long long int t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(m);
  vector<mint> dp(n + 1);
  for (long long int i = 0; i < m; i++) cin >> a[i];
  dp[0] = 1;
  long long int ia = 0;
  if (a[ia] == 1) {
    dp[1] = 0;
    ia++;
  } else
    dp[1] = 1;
  for (long long int i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    if (ia == m) continue;
    if (i == a[ia]) {
      dp[i] = 0;
      ia++;
    }
  }
  cout << dp[n].x << endl;
}
