#include <bits/stdc++.h>
int N, M;
std::vector<int> a;
uint64_t num;
bool solve(int i, int goal) {
  if (i == goal) {
    num++;
    return true;
  } else if (i > goal) {
    return false;
  }
  solve(i + 1, goal);
  solve(i + 2, goal);
  return true;
}
int main(int argc, char const* argv[]) {
  num = 0;
  std::cin >> N >> M;
  int tmp;
  while (std::cin >> tmp) {
    a.push_back(tmp);
  }
  std::sort(a.begin(), a.end());
  uint64_t sum = 1;
  int start = 0;
  for (const auto& e : a) {
    num = 0;
    solve(start, e - 1);
    sum *= num;
    start = e + 1;
  }
  num = 0;
  solve(start, N);
  sum *= num;
  std::cout << (sum % 1000000007ULL) << std::endl;
  return 0;
}
