#include <bits/stdc++.h>
using namespace std;
using int64 = int64_t;
using pii = pair<int, int>;
using pll = pair<int64_t, int64_t>;
template <typename T>
inline void chmin(T &a, T b) {
  if (a > b) a = b;
  return;
}
template <typename T>
inline void chmax(T &a, T b) {
  if (a < b) a = b;
  return;
}
const int64 MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  bool broken[101010] = {};
  vector<int> a(m);
  for (int i = 0; i < (int)(m); ++i) {
    cin >> a[i];
    broken[a[i]] = true;
  }
  for (int i = 0; i < m - 1; ++i) {
    if (a[i + 1] - a[i] == 1) {
      cout << (0) << '\n';
      return 0;
    }
  }
  int64 dp[101010] = {};
  if (a[0] == 1) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  dp[0] = 1;
  for (int i = 2; i <= n; ++i) {
    if (broken[i]) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << (dp[n] % MOD) << '\n';
  return 0;
}
