#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const ll N = 1e5, M = 1e5;
ll dp[100000];
ll a[100000];
const ll AA = 1000000007;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> a(N + 1, 1);
  int A;
  for (ll i = 0; i < M; i++) {
    cin >> A;
    a.at(A) = 0;
  }
  dp[0] = 1;
  if (a.at(1))
    dp[1] = 1;
  else
    dp[1] = 0;
  for (ll i = 2; i < N + 1; i++) {
    if (a.at(i))
      dp[i] = dp[i - 1] + dp[i - 2];
    else
      dp[i] = 0;
  }
  cout << dp[N] % AA << endl;
  return 0;
}
