#include <bits/stdc++.h>
int N, M;
std::vector<int> a;
uint64_t solve(int i, int goal, int num) {
  if (i == goal) {
    return num + 1;
  } else if (i > goal) {
    return num;
  }
  num = solve(i + 1, goal, num);
  num = solve(i + 2, goal, num);
  return num;
}
uint64_t solve2(int i, int goal, int num) {
  int dist = goal - i;
  if (dist > 5) {
    int sep = (goal - i) / 2 + i;
    auto v0 = solve2(i, sep, num);
    auto v1 = solve2(sep, goal, num);
    auto v2 = solve2(i, sep - 1, num);
    auto v3 = solve2(sep + 1, goal, num);
    return v0 * v1 + v2 * v3;
  } else {
    return solve(i, goal, num);
  }
}
int main(int argc, char const* argv[]) {
  std::cin >> N >> M;
  if (M == 0) {
    std::cout << solve2(0, N, 0) << std::endl;
    return 0;
  }
  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) {
    auto tmp = solve2(start, e - 1, 0);
    sum *= tmp;
    start = e + 1;
  }
  auto tmp2 = solve2(start, N, 0);
  sum *= tmp2;
  std::cout << (sum % 1000000007ULL) << std::endl;
  return 0;
}
