#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e15;
const long long int MOD = 1e9 + 7;
template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()) {
  return vector2<T>(n0, vector<T>(n1, e));
}
template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()) {
  return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(m);
  for (long long int i = 0; i < (m); ++i) {
    cin >> a[i];
    if (i > 0 && a[i] == a[i - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  vector<long long int> f(100000);
  f[0] = f[1] = 1;
  for (long long int i = 2; i < 100000; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  long long int pos = 0;
  long long int ans = 1;
  for (long long int i = 0; i < (m); ++i) {
    if (pos > a[i]) {
      continue;
    }
    long long int d = a[i] - pos - 1;
    ans *= f[d];
    ans %= MOD;
    pos = a[i] + 1;
  }
  if (pos < n) {
    long long int d = n - pos;
    ans *= f[d];
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
