#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const ll INF = 1e10;
const ll MOD = 1e9 + 7;
ll n, m;
ll dp[10005];
int main() {
  cin >> n >> m;
  ll s;
  bool floor[10005] = {0};
  for (ll i = (0); i < (m); ++i) {
    cin >> s;
    floor[s] = true;
  }
  dp[0] = 1;
  if (floor[1])
    dp[1] = 0;
  else
    dp[1] = 1;
  for (ll i = (2); i < (n + 1); ++i) {
    if (floor[i])
      dp[i] = 0;
    else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[n] << "\n";
}
