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