#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N = 0, M = 0;
  cin >> N >> M;
  vector<long long> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<int> onoff(N + 1);
  for (int i = 0; i < N + 1; i++) {
    onoff.at(i) = 1;
  }
  for (int i = 0; i < M; i++) {
    onoff.at(a.at(i)) = 0;
  }
  vector<long long> howtogo(N + 1);
  howtogo.at(0) = 1;
  howtogo.at(1) = 1;
  if (N == 1) {
    cout << 1 << endl;
  } else {
    for (int i = 2; i <= N; i++) {
      howtogo.at(i) = ((howtogo.at(i - 1) * onoff.at(i - 1)) % 1000000007 +
                       (howtogo.at(i - 2) * onoff.at(i - 2)) % 1000000007) %
                      1000000007;
    }
  }
  cout << howtogo.at(N) % 1000000007 << endl;
}
