#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = std::vector<T>;
template <class T>
using vvec = vec<vec<T>>;
constexpr std::size_t operator""_sz(ull n) { return std::size_t(n); }
int main() {
  using namespace std;
  constexpr ll mod = 1000000007;
  int n, m;
  cin >> n >> m;
  vec<int> a(m);
  vec<ll> dp(n + 1);
  for (auto &e : a) {
    cin >> e;
    dp[e] = -1;
  }
  dp[0] = 1;
  for (int i = 1; i <= n + 1; ++i) {
    if (dp[i] == -1) continue;
    if (dp[i - 1] != -1 && i - 1 >= 0) dp[i] += dp[i - 1];
    if (dp[i - 2] != -1 && i - 2 >= 0) dp[i] += dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[n] << endl;
  return 0;
}
