#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class _T>
inline bool chmax(_T& a, _T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class _T>
inline bool chmin(_T& a, _T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
const long long mod = 1000000007;
int main(void) {
  int n;
  cin >> n;
  int m;
  cin >> m;
  ll a[m], dp[n + 1];
  for (int i = 0; i < (n + 1); ++i) dp[i] = 0;
  for (int i = 0; i < (m); ++i) {
    cin >> a[i];
    dp[a[i]] = INF;
  }
  dp[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    if (dp[i] == INF) continue;
    if (dp[i - 1] != INF) dp[i] += dp[i - 1];
    if (i > 1 && dp[i - 2] != INF) dp[i] += dp[i - 2];
  }
  cout << dp[n] % mod << endl;
  return 0;
}
