#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, M;
  cin >> N >> M;
  vector<bool> bre(N + 1, false);
  int64_t a;
  for (int64_t i = 0; i < M; i++) {
    cin >> a;
    bre.at(a) = true;
  }
  int64_t pn = 0;
  int64_t pn_1 = 1;
  int64_t pn_2 = 1;
  for (int64_t i = 2; i < N + 1; i++) {
    if (bre.at(i - 1)) {
      pn = pn_2;
      pn_1 = 0;
    } else {
      pn = pn_1 + pn_2;
    }
    pn_2 = pn_1;
    pn_1 = pn;
  }
  cout << pn % 1000000007 << endl;
}
