#include <bits/stdc++.h>
using namespace std;
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;
}
using ll = long long;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll dp[100100];
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> v(100100, 0LL);
  for (ll i = 0LL; i < M; i++) {
    ll s;
    cin >> s;
    v[s] = 1LL;
  }
  dp[0] = 1LL;
  if (v[1] == 1LL) dp[1] = 0LL;
  if (v[1] == 0LL) dp[1] = 1LL;
  for (ll i = 2; i < 100000LL; i++) {
    if (v[i] == 1LL) dp[i] = 0LL;
    if (v[i] == 0LL) dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007LL;
  }
  cout << dp[N] << endl;
}
