#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
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 int MAX_N = 1e5 + 3;
ll dp[MAX_N];
ll mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  for (int i = 0; i < (MAX_N); ++i) dp[i] = 0;
  sort(a.begin(), a.end());
  dp[0] = 1;
  int cur = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == a[cur]) {
      cur++;
      continue;
    }
    dp[i] += dp[i - 1];
    if (i > 1) dp[i] += dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[n] << endl;
  return 0;
}
