#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 true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const ll INF = 1LL << 60;
int n, m;
ll a[100010];
ll dp[100010];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (m); i++) cin >> a[i];
  vector<int> x(n + 1, false);
  for (int i = 0; i < (m); i++) x[a[i]] = true;
  for (int i = 0; i < (100010); i++) dp[i] = 0;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (x[i]) continue;
    if (!x[i - 1]) dp[i] += dp[i - 1];
    if (i >= 2 && !x[i - 2]) dp[i] += dp[i - 2];
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
