#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
void view(T cont) {
  std::cout << cont << std::endl;
}
template <typename T>
void view(T* cont, ll sz) {
  for (ll i = 0; i < (ll)(sz); i++) std::cout << cont[i] << " ";
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& f : v) std::cout << f << " ";
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
const long long INF = 1LL << 60;
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;
}
const int MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a;
  for (ll i = 0; i < (ll)(M); i++) {
    int temp;
    cin >> temp;
    a.push_back(temp);
  }
  vector<int> dp(N + 1, 0);
  for (ll i = 0; i < (ll)(M); i++) dp[a[i]] = -1;
  dp[0] = 1;
  dp[-1] = -1;
  for (int i = 1; i <= N; i++) {
    if (dp[i] < 0) continue;
    dp[i] = max(dp[i - 2], 0) % MOD + max(dp[i - 1], 0) % MOD;
  }
  cout << dp[N] % MOD << endl;
}
