#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b);
template <class T>
inline bool chmax(T& a, T b);
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v);
template <class T>
int64_t sum(vector<T> a);
template <class T>
double ave(vector<T> a);
uint64_t n, m;
int main() {
  cin >> n >> m;
  vector<uint64_t> a(m);
  vector<uint64_t> f(100010);
  f[0] = 1;
  f[1] = 1;
  for (int64_t i = 0; i < m; i++) {
    cin >> a[i];
  }
  uint64_t pos = 0;
  uint64_t fpos = 1;
  uint64_t cnt = 1;
  for (int64_t an = 0; an <= m; an++) {
    int64_t d = 0;
    if (an < m) {
      d = a[an] - pos - 1;
      pos = a[an] + 1;
      if (an + 1 < m && a[an + 1] == pos) {
        cnt = 0;
        an = m;
        break;
      }
    }
    if (an == m) {
      d = n - pos;
      pos = m;
    }
    if (fpos < d) {
      uint64_t sf = 1;
      for (uint64_t i = fpos; i <= d; i++) {
        f[i] = f[i - 1] + f[i - 2];
      }
      fpos = d;
    }
    cnt *= f[d];
  }
  cout << cnt % 1000000007 << endl;
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "\t";
  }
  return s;
}
