#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> a(N + 1, 0);
  for (int i = 1; i <= M; i++) {
    ll temp;
    cin >> temp;
    a[temp] = -1;
  }
  a[0] = 1;
  if (a[1] != -1) {
    a[1] = 1;
  }
  for (int i = 2; i <= N; i++) {
    if (a[i] == -1) {
      continue;
    }
    a[i] = 0;
    if (a[i - 1] != -1) {
      a[i] += a[i - 1];
    }
    if (a[i - 2] != -1) {
      a[i] += a[i - 2];
    }
  }
  cout << a[N] % 1000000007 << endl;
  return 0;
}
