#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
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() {
  ll dp[100010];
  for (int i = 0; i < 100010; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  int n, m;
  cin >> n >> m;
  vector<int> ST(n + 1, 0);
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    ST[a] = -1;
  }
  for (int i = 0; i < (n + 1); ++i) {
    if (i > 0) {
      if (ST[i - 1] == 0) dp[i] += dp[i - 1];
    }
    if (i > 1) {
      if (ST[i - 2] == 0) dp[i] += dp[i - 2];
    }
  }
  cout << dp[n] % 1000000007 << endl;
}
