#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int QP(int a, int b) {
  int ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % MOD;
    a = 1ll * a * a % MOD;
  } while (b >>= 1);
  return ans;
}
int QP(int a, int b, int MOD) {
  int ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % MOD;
    a = 1ll * a * a % MOD;
  } while (b >>= 1);
  return ans;
}
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  for (int i = (0); i < (M); ++i) cin >> A.at(i);
  vector<long long> dp(N + 1, -1);
  dp.at(0) = 1;
  if (A.front() != 1) dp.at(1) = 1;
  for (auto a : A) {
    dp.at(a) = 0;
  }
  for (int i = (2); i < (N + 1); ++i) {
    if (dp.at(i) != 0) dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % MOD;
  }
  cout << dp.back() << "\n";
  return 0;
}
