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