#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
const long double EPS = 1e-10;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const long long mods = 1000000007;
template <class T>
inline void amax(T &a, const T &b) {
  if (a < b) a = b;
}
template <class T>
inline void amin(T &a, const T &b) {
  if (a > b) a = b;
}
signed main() {
  long long N;
  long long M;
  scanf("%lld", &N);
  scanf("%lld", &M);
  vector<long long> a(N + 1, 0);
  long long temp;
  for (long long i = (long long)0; i < (long long)M; i++) {
    scanf("%lld", &temp);
    a[temp] = 1;
  }
  vector<long long> ans(N + 1, 0);
  ans[0] = 1;
  for (int j = 0; j <= N - 1; ++j) {
    if (a[j + 1] == 0) ans[j + 1] += (ans[j]);
    if (j <= N - 2) {
      if (a[j + 2] == 0) ans[j + 2] += (ans[j]);
    }
    if (ans[j] == 0) continue;
  }
  printf("%lld\n", ans[N] % mods);
}
