#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 1);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  a.at(M) = -1;
  vector<int> S(N + 1);
  S.at(0) = 1;
  if (a.at(0) == 1) {
    S.at(1) = 0;
    int x = 1;
    for (int i = 2; i <= N; i++) {
      if (i == a.at(x)) {
        S.at(i) = 0;
        x++;
      }
      else {
        S.at(i) = (S.at(i - 1) + S.at(i - 2)) % 1000000007;
      }
    }
  }
  else {
    S.at(1) = 1;
    int y = 0;
    for (int i = 2; i <= N; i++) {
      if (i == a.at(y)) {
        S.at(i) = 0;
        x++;
      }
      else {
        S.at(i) = (S.at(i - 1) + S.at(i - 2)) % 1000000007;
      }
    }
  }
  cout << S.at(N) << endl;
}
