#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template <class T, class U>
void init_n(vector<T>& v, size_t n, U x) {
  v = vector<T>(n, x);
}
template <class T>
void init_n(vector<T>& v, size_t n) {
  init_n(v, n, T());
}
template <class T>
void read_n(vector<T>& v, size_t n, size_t o = 0) {
  v = vector<T>(n + o);
  for (size_t i = o; i < n + o; ++i) cin >> v[i];
}
template <class T>
void read_n(T a[], size_t n, size_t o = 0) {
  for (size_t i = o; i < n + o; ++i) cin >> a[i];
}
template <class T>
T gabs(const T& x) {
  return max(x, -x);
}
const i64 mod = 1e9 + 7;
i64 n, m;
vector<i64> a, b, dp;
i64 f(i64 x) {
  if (dp[x] > 0) return dp[x];
  if (b[x]) return 0;
  if (x <= 1) return 1;
  return dp[x] = (f(x - 1) + f(x - 2)) % mod;
}
int main() {
  cin >> n >> m;
  read_n(a, m);
  init_n(b, n + 1);
  for (i64 x : a) {
    b[x] = 1;
  }
  init_n(dp, n + 1);
  cout << f(n) << '\n';
  return 0;
}
