#include <bits/stdc++.h>
using namespace std;
template <typename Typell>
Typell G_C_D(Typell a, Typell b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  while (b != 0) {
    a %= b;
    if (a == 0) return b;
    b %= a;
  }
  return a;
}
template <typename Typell>
Typell G_C_D(const std::vector<Typell> &list) {
  Typell a = list[0];
  for (size_t i = 1; i < list.size(); ++i) {
    a = G_C_D(a, list[i]);
  }
  return a;
}
template <typename Typell>
Typell L_C_M(Typell a, Typell b) {
  if (a == 0 && b == 0) return 0;
  return a / G_C_D(a, b) * b;
}
template <typename Typell>
Typell L_C_M(const std::vector<Typell> &list) {
  Typell a = list[0];
  for (size_t i = 1; i < list.size(); ++i) {
    a = L_C_M(a, list[i]);
  }
  return a;
}
int fib_memo[10000] = {0};
int fib(int n) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (fib_memo[n] != 0) {
    return fib_memo[n];
  }
  return fib_memo[n] = fib(n - 1) + fib(n - 2);
}
int main() {
  long long N = 0, M = 0;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < M - 1; ++i) {
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long> saigo(M + 1);
  saigo[0] = a[0];
  for (long long i = 0; i < M - 1; ++i) {
    saigo[i + 1] = a[i + 1] - a[i] - 1;
  }
  saigo[M] = N - a[M - 1];
  vector<long long> seki(M + 1);
  for (long long i = 0; i < M + 1; ++i) {
    long long t;
    t = fib(saigo[i]);
    seki[i] = t;
  }
  long long ans = 1;
  for (long long i = 0; i < M + 1; ++i) {
    ans *= seki[i];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
