#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
const vector<ll> dx = {0, 1, 0, -1}, dy = {1, 0, -1, 0};
vector<vector<ll>> grid;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N, M;
  cin >> N >> M;
  vector<ll> a(N + 3);
  for (ll i = 0; i < M; ++i) {
    ll hoge;
    cin >> hoge;
    a[hoge] = -1;
  }
  for (ll i = 0; i < 2; ++i) {
    if (a[i] == -1) {
      continue;
    }
    a[i] = 1;
  }
  for (ll i = 2; i <= N; ++i) {
    int sum = 0;
    if (a[i - 1] != -1) {
      sum += a[i - 1];
    }
    if (a[i - 2] != -1) {
      sum += a[i - 2];
    }
    a[i] = sum % static_cast<ll>(1e9 + 7);
  }
  cout << a[N] << "\n";
}
