#include <bits/stdc++.h>
using namespace std;
void print() { std::cout << std::endl; }
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
  std::cout << head;
  if (sizeof...(tail) != 0) std::cout << " ";
  print(std::forward<Tail>(tail)...);
}
template <class T>
void print(std::vector<T> &vec) {
  for (auto &a : vec) {
    std::cout << a;
    if (&a != &vec.back()) std::cout << " ";
  }
  std::cout << std::endl;
}
template <class T>
void print(std::vector<std::vector<T>> &df) {
  for (auto &vec : df) {
    print(vec);
  }
}
int count = 0;
int step(int n, int now, vector<int> a) {
  if (now >= (n - 1)) {
    return 1;
  }
  if (find(a.begin(), a.end(), now + 1) != a.end() &&
      find(a.begin(), a.end(), now + 2) != a.end()) {
    return 0;
  }
  if (find(a.begin(), a.end(), now + 1) != a.end() &&
      find(a.begin(), a.end(), now + 2) == a.end()) {
    return step(n, now + 2, a);
  }
  if (find(a.begin(), a.end(), now + 1) == a.end() &&
      find(a.begin(), a.end(), now + 2) != a.end()) {
    return step(n, now + 1, a);
  }
  if (find(a.begin(), a.end(), now + 1) == a.end() &&
      find(a.begin(), a.end(), now + 2) == a.end()) {
    return step(n, now + 1, a) + step(n, now + 2, a);
  }
  return 0;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  print(step(n, 0, a) % 1000000007);
}
