#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
int main() {
  ll n, m;
  cin >> n >> m;
  vl a(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
  }
  vl dp(n + 1, -1);
  for (int i = 0; i < m; ++i) {
    dp[a[i]] = 0;
  }
  dp[0] = 1;
  if (a[0] != 1)
    dp[1] = 1;
  else
    dp[1] = 0;
  for (int i = 2; i <= n; ++i) {
    if (dp[i] != 0) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[n] << "\n";
  return 0;
}
