#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long INF = 1e16;
int inf = 1e9;
long long MOD = 1e9 + 7;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  os << "{ ";
  for (int i = (0); i < (vec.size()); ++i) {
    os << vec[i] << " ";
  }
  os << "}";
  return os;
}
void d_err() { cerr << endl; }
template <typename H, typename... T>
void d_err(H h, T... t) {
  cerr << h << " ";
  d_err(t...);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = (0); i < (M); ++i) cin >> a[i];
  long long dp[N + 1];
  memset(dp, 0, sizeof(dp));
  dp[0] = 1;
  int j = 0;
  for (int i = (0); i < (N + 1); ++i) {
    if (a[j] == i) {
      ++j;
      continue;
    }
    dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
    dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
  }
  cout << dp[N] << endl;
}
