#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vc = vector<char>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vvi;
const int INF = 1001001001;
const int MOD = 1000000007;
const long long INFL = (1LL << 60);
const double EPS = 1e-9;
vector<bool> isSafe;
vll dp;
int main() {
  int N, M;
  cin >> N >> M;
  isSafe.assign(N + 1, true);
  for (int i = 0; i < (int)(M); i++) {
    int a;
    cin >> a;
    isSafe[a] = false;
  }
  dp.assign(N + 1, 0);
  dp[0] = 1;
  if (isSafe[1]) dp[1] = 1;
  for (int n = (2); n < (int)(N + 1); n++) {
    if (isSafe[n - 2]) dp[n] += dp[n - 2];
    if (isSafe[n - 1]) dp[n] += dp[n - 1];
  }
  cout << dp[N] % MOD << endl;
}
