#include <bits/stdc++.h>
const long mod = 1000000007;
long solve(int n, std::vector<int> brokens) {
  std::vector<long> c(n + 1);
  c[0] = 1;
  c[1] = 1;
  c[2] = 2;
  for (int i = 3; i <= n; ++i) {
    c[i] = c[i - 1] + c[i - 2];
  }
  long result = 1;
  int prev = -1;
  for (auto& a : brokens) {
    int d = a - prev - 2;
    if (a == 1) d = 1;
    if (d == -1) return 0;
    prev = a;
    result *= c[d];
    result %= mod;
  }
  auto dd = brokens.empty() ? n : n - brokens.back() - 1;
  if (dd >= 2) {
    result *= c[dd];
    result %= mod;
  }
  return result;
}
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<int> brokens(m);
  for (auto& a : brokens) {
    std::cin >> a;
  }
  std::cout << solve(n, std::move(brokens)) % mod << std::endl;
}
