#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> a(M);
  for (ll i = 0; i < M; ++i) cin >> a[i];
  ll num[100100] = {};
  ll brokenis1[100100] = {};
  for (ll i = 0; i < M; ++i) brokenis1[a[i]] = 1;
  num[0] = 1;
  num[1] = 0;
  for (ll i = 2; i <= N; i++) {
    if (brokenis1[i] == 0) {
      num[i] = (num[i - 1] + num[i - 2]) % 1000000007;
    }
  }
  cout << num[N] << "\n";
}
