#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 true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  const ll mod = 1000000007;
  int N, M;
  cin >> N >> M;
  vector<ll> a(M, 0);
  vector<ll> dp(N + 3, 0);
  vector<bool> broken(N + 1, false);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    broken[a[i]] = true;
  }
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (broken[i + 1] == false) dp[i + 1] += dp[i];
    if (broken[i + 2] == false) dp[i + 2] += dp[i];
  }
  cout << dp[N] % mod << "\n";
}
