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