#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
const int DAM = -1;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(N + 1, 0);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    dp.at(a) = -1;
  }
  dp.at(0) = 1;
  dp.at(1) = 1;
  for (int i = 2; i <= N; i++) {
    if (dp.at(i) != -1) {
      dp.at(i) = (dp.at(i) + max(0ll, dp.at(i - 1))) % 1000000007;
      if (i >= 2) dp.at(i) = (dp.at(i) + max(0ll, dp.at(i - 2))) % 1000000007;
    }
  }
  cout << dp.at(N) << endl;
}
