#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
long long N, M;
vector<long long> a;
unordered_set<long long> b;
vector<long long> f(100001);
long long k;
long long fun(long long i) {
  if (b.find(i) != b.end()) {
    return 0;
  } else {
    if (i == 0) {
      f[i] = 1;
      return 1;
    }
    if (i == 1) {
      f[i] = 1;
      return 1;
    }
  }
  if (f[i] != 0) {
    return f[i];
  }
  f[i] = (fun(i - 2) + fun(i - 1)) % 1000000007;
  return f[i];
}
signed main() {
  cin >> N >> M;
  a.resize(M);
  long long temp = 0;
  long long temp2 = 0;
  bool c = false;
  for (long long i = 0; i < (M); i++) {
    temp2 = temp;
    cin >> temp;
    if (temp - temp2 == 1) {
      c = true;
    }
    b.insert(temp);
  }
  if (c) {
    cout << 0 << endl;
    return 0;
  }
  for (long long i = 0; i < (N); i++) {
    fun(i);
  }
  long long ans = fun(N);
  cout << ans << endl;
  return 0;
}
