#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> memo{
    {0, 1},
    {1, 1},
    {2, 2},
};
template <class T>
void show(vector<T>& v) {
  for (uint i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
int calc_path(int sep) {
  auto itr = memo.find(sep);
  if (itr == end(memo)) {
    memo.emplace(sep, calc_path(sep - 1) + calc_path(sep - 2));
  }
  return memo[sep];
}
int main(int argc, char* argv[]) {
  uint N, M;
  cin >> N >> M;
  long long product = 1;
  if (M != 0) {
    vector<uint> a(M, 0);
    for (uint i = 0; i < M; i++) {
      cin >> a[i];
    }
    for (uint i = 1; i < M; i++) {
      if (a[i] - a[i - 1] == 1) {
        cout << "0" << endl;
        exit(0);
      }
    }
    vector<int> separate(M + 1, 0);
    separate[M] = N - *(a.end() - 1) - 1;
    for (uint i = 0; i < M; i++) {
      if (i == 0) {
        separate[i] = a[i] - 0 - 1;
      } else {
        separate[i] = a[i] - a[i - 1] - 2;
      }
    }
    for (uint i = 0; i < M + 1; i++) {
      product *= calc_path(separate[i]);
    }
  } else {
    product = calc_path(M);
  }
  cout << product % 1000000007 << endl;
  return 0;
}
