#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
template <long long MOD = 1000000007>
class MODLL {
 public:
  long long x;
  MODLL(const long long _x) : x(_x % MOD){};
  MODLL operator+(const MODLL rhs) const { return MODLL(*this) += rhs; }
  MODLL operator-(const MODLL rhs) const { return MODLL(*this) -= rhs; }
  MODLL operator*(const MODLL rhs) const { return MODLL(*this) *= rhs; }
  MODLL operator/(const MODLL rhs) const { return MODLL(*this) /= rhs; }
  MODLL& operator+=(const MODLL rhs) {
    x += rhs.x;
    x %= MOD;
    return *this;
  }
  MODLL& operator-=(const MODLL rhs) {
    x -= rhs.x;
    x %= MOD;
    if (x < 0) x += MOD;
    return *this;
  }
  MODLL& operator*=(const MODLL rhs) {
    x *= rhs.x;
    x %= MOD;
    return *this;
  }
  MODLL inv() const {
    if (x == 0) {
      throw "does not have inverse";
    }
    long long a = x, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    u %= MOD;
    if (u < 0) u += MOD;
    return MODLL(u);
  }
  MODLL& operator/=(const MODLL rhs) {
    (*this) *= rhs.inv();
    return *this;
  }
  MODLL pow(unsigned long long n) const {
    MODLL res = 1;
    MODLL a = x;
    while (n > 0) {
      if (n & 1) res *= a;
      a = a * a;
      n >>= 1;
    }
    return res;
  }
};
void test() {
  {
    MODLL<> x = 3;
    assert(x.pow(45).x == 644897553);
  }
  {
    for (int i = 1; i < 13; i++) {
      MODLL<13> x = i;
      assert((x.inv().x * i) % 13 == 1);
    }
  }
}
int main() {
  long long N, M;
  std::cin >> N >> M;
  std::vector<int> H(N, 0);
  for (long long i = 0; i < M; i++) {
    int a;
    cin >> a;
    H[a] = 1;
  }
  std::vector<MODLL<> > dp(N + 1, 0);
  dp[N] = 1;
  for (int i = N - 1; i >= 0; i--) {
    if (H[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i + 1] + dp[i + 2];
  }
  std::cout << dp[0].x << std::endl;
  return 0;
}
