#include <bits/stdc++.h>
using namespace std;
unsigned long long step(long num);
int main(void) {
  unsigned long long N, M;
  std::cin >> N >> M;
  std::vector<unsigned long long> steps;
  int first = 1;
  for (int i = 0; i < M; i++) {
    int a;
    std::cin >> a;
    long long tmp = a - first;
    if (tmp < 0) {
      std::cout << "0" << std::endl;
      return 0;
    }
    steps.push_back(tmp);
    first = a + 2;
    if (i == M - 1) {
      unsigned long long tmp = N - a - 1;
      steps.push_back(tmp);
    }
  }
  unsigned long ans = 1;
  for (auto sptr = steps.begin(); sptr != steps.end(); sptr++) {
    if (*sptr == 0) {
      if (sptr == steps.begin()) {
        *sptr = 1;
      } else {
        std::cout << 0 << std::endl;
        return 0;
      }
    }
    ans = ans * step(*sptr);
  }
  if (ans >= 1000000007) {
    ans = ans % 1000000007;
  }
  std::cout << ans << std::endl;
  return 0;
}
unsigned long long step(long num) {
  unsigned long long f1 = 0;
  unsigned long long f0 = 1;
  unsigned long long ans = 0;
  if (num == 0) {
    return 0;
  }
  for (int i = 0; i < num + 1; i++) {
    ans = f1 + f0;
    f0 = f1;
    f1 = ans;
  }
  return ans;
}
