#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 1e9 + 7;
  int N, M;
  cin >> N >> M;
  vector<bool> a(N + 1, true);
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    a[x] = false;
  }
  vector<long long> d(N);
  d[0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j <= min(i + 2, N); j++) {
      if (a[j]) {
        d[j] += d[i];
        d[j] %= mod;
      }
    }
  }
  cout << d[N] << endl;
}
