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