#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using Graph = vector<vector<long long>>;
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;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> vec(m);
  for (long long i = 0; i < (m); i++) {
    cin >> vec.at(i);
  }
  vector<long long> dp(n + 1);
  dp.at(0) = 1;
  long long tmp = 0;
  for (long long i = 0; i < (n + 1); i++) {
    if (i == 1) {
      if (vec.at(tmp) == 1) {
        tmp++;
        continue;
      } else {
        dp.at(1) = 1;
        continue;
      }
    }
    if (tmp < m && i == vec.at(tmp)) {
      tmp++;
      continue;
    }
    if (i >= 2) {
      dp.at(i) = dp.at(i - 1) % MOD + dp.at(i - 2) % MOD;
      dp.at(i) = dp.at(i) % MOD;
    }
  }
  cout << dp.at(n) << endl;
}
