#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;
}
ll mod = 1e9 + 7;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> stair(n + 1, true);
  for (ll i = 0; i < m; i++) {
    ll x;
    cin >> x;
    stair[x] = false;
  }
  ll dp[n + 1];
  for (int i = 0; i < n + 1; i++) dp[i] = 0;
  dp[0] = 1;
  for (ll i = 1; i < n + 1; i++) {
    if (i > 1) {
      if (stair[i])
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
      else
        dp[i] = 0;
    } else {
      if (dp[i])
        dp[i] = dp[i - 1];
      else
        dp[i] = 0;
    }
  }
  cout << dp[n] % mod << endl;
}
