#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (int)(m); ++i) cin >> a[i];
  const int MOD = 1e9 + 7;
  ll dp[100100];
  for (int i = 0; i < 100100; ++i) {
    dp[i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    dp[a[i]] = -1;
  }
  dp[0] = 0;
  if (dp[1] == -1 && dp[2] != -1) {
    dp[1] = 0;
    dp[2] = 1;
  } else if (dp[1] != -1 && dp[2] == -1) {
    dp[1] = 1;
    dp[2] = 0;
  } else if (dp[1] == -1 && dp[2] == -1) {
    dp[1] = 0;
    dp[2] = 0;
  } else {
    dp[1] = 1;
    dp[2] = 2;
  }
  for (int i = 3; i <= n; ++i) {
    if (dp[i] == -1) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  ll ans = dp[n] % MOD;
  cout << ans << endl;
  return 0;
}
