#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(max(2, M));
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<int64_t> way(max(2, N));
  if (a.at(0) > 2 || a.at(0) == 0) {
    way.at(0) = 1;
    way.at(1) = 2;
  } else if (a.at(0) == 2) {
    way.at(0) = 1;
    way.at(1) = 0;
  } else if (a.at(0) == 1 && a.at(1) == 2) {
    way.at(0) = 0;
    way.at(1) = 0;
  } else if (a.at(0) == 1 && a.at(1) != 2) {
    way.at(0) = 0;
    way.at(1) = 1;
  }
  for (int i = 2; i < N; i++) {
    way.at(i) = way.at(i - 1) + way.at(i - 2);
    for (int j = 0; j < M; j++) {
      if (a.at(j) == i + 1) {
        way.at(i) = 0;
      } else if (a.at(j) > i + 1) {
        break;
      }
    }
  }
  cout << way.at(N - 1) % 1000000007 << endl;
}
