#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int N;
int M;
vector<bool> issafe;
vector<long long> dp(110000);
const long long INF = 1LL << 60;
int main() {
  cin >> N >> M;
  int count = 0;
  issafe.assign(N, true);
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    issafe[a] = false;
  }
  dp[0] = 1;
  if (issafe[1]) dp[1] = 1;
  for (int i = 2; i <= N; ++i) {
    if (issafe[i - 1]) dp[i] += dp[i - 1];
    if (issafe[i - 2]) dp[i] += dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[N] << '\n';
  return 0;
}
