#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T>
using VEC = std::vector<T>;
template <class T>
using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail>
void DUMP(Head &&head, Tail &&...tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m) os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}
LL MM = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  VEC<int> A(M);
  set<int> S;
  for (long long i = (0); i < (long long)(M); ++i) {
    cin >> A[i];
    S.insert(A[i]);
  }
  sort(A.begin(), A.end());
  VEC<LL> p(N + 1, 0);
  p[0] = 1;
  if (A[0] != 1) p[1] = 1;
  for (long long i = (2); i < (long long)(N + 1); ++i) {
    LL next = 0;
    if (S.count(i - 1) == 0) {
      next += p[i - 1];
    }
    if (S.count(i - 2) == 0) {
      next += p[i - 2];
    }
    p[i] = next % MM;
  }
  cout << p[N] << endl;
  return 0;
}
