#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> A(M);
  for (long long i = 0; i < M; i++) {
    cin >> A.at(i);
  }
  vector<long long> Number_of_ways(N + 1);
  int fall = 0;
  Number_of_ways.at(0) = 1;
  for (long long i = 1; i <= N; i++) {
    if (i == A.at(fall)) {
      Number_of_ways.at(i) = 0;
      if (fall < M - 1) fall++;
    } else {
      if (i == 1) {
        Number_of_ways.at(i) = Number_of_ways.at(i - 1) % 1000000007;
      } else {
        Number_of_ways.at(i) =
            (Number_of_ways.at(i - 1) + Number_of_ways.at(i - 2)) % 1000000007;
      }
    }
  }
  cout << Number_of_ways.at(N) << endl;
}
