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