#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;
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 GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
constexpr auto MAX = 100010;
int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> isBroken(n + 1, false);
  for (int i = 0; i < m; i++) {
    int val;
    cin >> val;
    isBroken[val] = true;
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  if (!isBroken[1]) dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!isBroken[i - 1]) dp[i] += dp[i - 1];
    if (!isBroken[i - 2]) dp[i] += dp[i - 2];
    dp[n] %= mod;
  }
  cout << dp[n] << endl;
}
