#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
int N;
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  bool broken[N];
  long long res[N];
  for (int i = 0; i < N; ++i) {
    broken[i] = false;
    res[i] = 0;
  }
  int m;
  for (int i = 0; i < M; ++i) {
    cin >> m;
    broken[m] = true;
  }
  for (int i = 1; i <= N; ++i) {
    if (i == 1 && broken[i] == false) {
      res[i] = 1;
    }
    if (i == 2 && broken[i] == false) {
      res[i] = res[i - 1] + 1;
    }
    if (i > 2 && res[i - 1] == 0 && res[i - 2] == 0) {
      cout << 0 << endl;
      return 0;
    }
    if (i > 2 && broken[i] == false) {
      res[i] = res[i - 1] % 1000000007 + res[i - 2] % 1000000007;
    }
  }
  cout << res[N] % 1000000007 << endl;
}
