#include <bits/stdc++.h>
std::vector<int64_t> makeFib() {
  int64_t f0 = 0, f1 = 1, f2;
  std::vector<int64_t> fib;
  fib.reserve(100000);
  fib.push_back(0);
  for (int i = 0; i < 100000; i++) {
    fib.emplace_back(f1);
    f2 = (f1 + f0) % 1000000007l;
    f0 = f1;
    f1 = f2;
  }
  return fib;
}
int main() {
  int N, M;
  std::cin >> N;
  std::cin >> M;
  std::vector<int> nums;
  for (int i = 0; i < M; i++) {
    int num;
    std::cin >> num;
    nums.push_back(num);
  }
  std::vector<int64_t> fibs = makeFib();
  int64_t result = 1;
  int prev = -1;
  for (int num : nums) {
    int space = num - prev - 1;
    result = (result * fibs[space]) % 1000000007l;
    prev = num;
  }
  int space = (N + 1) - prev - 1;
  result = (result * fibs[space]) % 1000000007l;
  std::cout << result % 1000000007l;
}
