#include <bits/stdc++.h>
int fib(int x) {
  if (x == 0)
    return 0;
  else if (x == 1)
    return 1;
  else
    return fib(x - 1) + fib(x - 2);
}
int main() {
  int size, broken;
  std::cin >> size >> broken;
  std::vector<int> buf(broken);
  for (auto &e : buf) std::cin >> e;
  int64_t count = 0;
  if (broken == 0)
    count = fib(size);
  else if (broken == 1)
    count = fib(buf[0]) * fib(size - buf[0]);
  else {
    count = fib(buf[0]);
    for (auto i = 0; i < buf.size() - 1; ++i) {
      auto diff = buf[i + 1] - buf[i];
      if (diff < 2) {
        std::cout << 0;
        return 0;
      }
      count *= fib(diff - 1);
    }
    count *= fib(size - buf[buf.size() - 1]);
  }
  std::cout << count % (1000000007);
  return 0;
}
