#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll ans = 0;
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); i++) cin >> a[i];
  vector<ll> dp(n + 1, 0);
  dp[0] = 1;
  for (int i = 0; i < (m); i++) dp[a[i]] = -1;
  for (int i = 0; i < n - 1; i++) {
    if (dp[i + 1] == -1)
      dp[i + 1] = 0;
    else
      dp[i + 1] += dp[i];
    if (dp[i + 2] == 0) {
      dp[i + 2] += dp[i];
    }
  }
  if (a[m] != n - 1) dp[n] += dp[n - 1];
  ans = dp[n];
  cout << ans % 1000000007 << "\n";
  return 0;
}
