#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<long long, bool>> a(N + 1);
  for (int i = 0; i < N + 1; i++) a.at(i).second = true;
  for (int i = 0; i < M; i++) {
    int b;
    cin >> b;
    a.at(b).second = false;
  }
  a.at(0).first = 1;
  if (a.at(1).second == false) {
    a.at(1).first = 0;
  } else
    a.at(1).first = 1;
  for (int i = 2; i < N + 1; i++) {
    if (!a.at(i).second)
      a.at(i).first = 0;
    else
      a.at(i).first = a.at(i - 1).first + a.at(i - 2).first;
  }
  cout << a.at(N).first % 1000000007 << endl;
}
