#include <bits/stdc++.h>
using namespace std;
class mod {
 public:
  mod() { m_n = 0; }
  mod(long long n) {
    if (n >= 0)
      m_n = n % (1000000007LL);
    else
      m_n = n % (1000000007LL) + (1000000007LL);
  }
  friend bool operator==(const mod& a, const mod& b) { return a.m_n == b.m_n; }
  friend bool operator!=(const mod& a, const mod& b) { return !(a == b); }
  friend mod operator+(const mod& a, const mod& b) {
    return (a.m_n + b.m_n) % (1000000007LL);
  }
  friend mod& operator+=(mod& a, const mod& b) { return a = a + b; }
  friend mod operator-(const mod& a) { return -a.m_n; }
  friend mod operator-(const mod& a, const mod& b) {
    return (a.m_n + (-b.m_n)) % (1000000007LL);
  }
  friend mod& operator-=(mod& a, const mod& b) { return a = a - b; }
  friend mod operator*(const mod& a, const mod& b) {
    return (a.m_n * b.m_n) % (1000000007LL);
  }
  friend mod& operator*=(mod& a, const mod& b) { return a = a * b; }
  friend mod mod_pow(const mod& n, long long r) {
    if (r == 0) {
      return 1;
    } else if (r < 0) {
      return mod_pow(n, ((1000000007LL) - 2) * (-r));
    } else if (r % 2 == 0) {
      mod tmp = mod_pow(n, r / 2);
      return tmp * tmp;
    } else {
      return n * mod_pow(n, r - 1);
    }
  }
  friend mod operator/(const mod& a, const mod& b) {
    return a * mod_pow(b, -1);
  }
  friend mod& operator/=(mod& a, const mod& b) { return a = a / b; }
  friend ostream& operator<<(ostream& os, const mod& n) {
    os << n.m_n;
    return os;
  }
  friend istream& operator>>(istream& is, mod& n) {
    long long tmp;
    is >> tmp;
    n = mod(tmp);
    return is;
  }

 private:
  long long m_n;
};
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int m = 0; m < M; ++m) cin >> A[m];
  vector<mod> DP(N + 1);
  DP[0] = 1;
  int mTmp = 0;
  for (int n = 1; n <= N; ++n) {
    if (A[mTmp] == n) {
      DP[n] = 0;
      ++mTmp;
    } else {
      DP[n] = DP[n - 1];
      if (n >= 2) DP[n] += DP[n - 2];
    }
  }
  cout << DP[N] << endl;
  return 0;
}
