#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> bad(M);
  vector<int> vec(N, 0);
  for (int i = 0; i < M; i++) {
    cin >> bad[i];
  }
  vec[0] = 1;
  vec[1] = 2;
  for (int i = 2; i < N; i++) {
    bool data = false;
    for (int j = 0; j < M; j++) {
      if (i == bad[j]) {
        vec[i] = 0;
        data = true;
      }
    }
    if (data) continue;
    vec[i] = vec[i - 1] + vec[i - 2];
  }
  cout << vec[N - 1] % 1000000007 << endl;
}
