#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <vector>

static const int IINF = 1 << 30;
static const long long LINF = 1LL << 60;
static const long long MOD = 1.0e+9 + 7;

template <typename T> std::vector<T> vectors(std::size_t n, T val) {
  return std::vector<T>(n, val);
}

template <typename T, typename... Args>
auto vectors(std::size_t n, Args... args) {
  return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...));
}

template <class T> inline bool chmin(T &a, const T &b) {
  return (a > b) ? a = b, true : false;
}

template <class T> inline bool chmax(T &a, const T &b) {
  return (a < b) ? a = b, true : false;
}

template <class T> inline void chadd(T &a, const T &b) {
  a += b, a %= MOD;
  // TODO minus case
}

template <class T>
std::ostream &operator<<(std::ostream &s, const std::vector<T> &v) {
  if (v.empty())
    return s;
  s << *v.begin();
  for (auto iter = v.begin() + 1; iter != v.end(); ++iter)
    if (std::is_fundamental<T>::value)
      s << " " << *iter;
    else
      s << std::endl << *iter;
  return s;
}

int main() {
  // Input
  int N, M;
  std::cin >> N >> M;
  std::vector<int> a(M);
  for (int i = 0; i < M; ++i)
    std::cin >> a[i];

  // Main
  int N_ = N;
  if (N_ < 3)
    N_ = 3;
  std::vector<long long> f(N_ + 1);
  f[0] = 0;
  f[1] = 1;
  f[2] = 1;
  for (int i = 3; i <= N; ++i) {
    f[i] = f[i - 1] + f[i - 2];
    f[i] %= MOD;
  }

  long long res = 1;
  for (int i = 0; i < M; ++i) {
    if (i == 0) {
      int d = a[0];
      // std::cout << d << std::endl;
      res *= f[d];
      res %= MOD;
      continue;
    }
    if (a[i] == a[i - 1])
      continue;
    int d = a[i] - a[i - 1] - 1;
    // std::cout << d << std::endl;
    res *= f[d];
    res %= MOD;
  }
  int d = N - a[M - 1];
  // std::cout << d << std::endl;
  res *= f[d];
  res %= MOD;

  // Output
  std::cout << res << std::endl;

  return 0;
}
