#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll INF = 1ll << 60;
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
ll MOD = 1000000007;
constexpr ll MAX_N = 100010;
ll dp[MAX_N];
bool is_exist(ll num, vector<ll> &v) {
  auto it = find(v.begin(), v.end(), num);
  return (it != v.end() ? true : false);
}
int main(int argc, char **argv) {
  ll N, M;
  cin >> N >> M;
  vector<ll> a(M);
  for (int i = 0; i < M; ++i) cin >> a[i];
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; ++i) {
    if (!is_exist(i - 1, a)) dp[i] += dp[i - 1];
    if (!is_exist(i - 2, a)) dp[i] += dp[i - 2];
    dp[i] %= MOD;
  }
  std::cout << dp[N] << std::endl;
}
