#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
long long powmod(long long x, long long n) {
  long long ret = 1;
  while (n > 0) {
    if (n & 1) ret = ret * x % 1000000007;
    x = x * x % 1000000007;
    n >>= 1;
  }
  return ret;
}
long long ctoi(char c) {
  switch (c) {
    case '0':
      return 0;
    case '1':
      return 1;
    case '2':
      return 2;
    case '3':
      return 3;
    case '4':
      return 4;
    case '5':
      return 5;
    case '6':
      return 6;
    case '7':
      return 7;
    case '8':
      return 8;
    case '9':
      return 9;
    default:
      return 0;
  }
}
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
bool isPrime(long long x) {
  long long i;
  if (x < 2)
    return 0;
  else if (x == 2)
    return 1;
  if (x % 2 == 0) return 0;
  for (i = 3; i * i <= x; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> ret;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
long long nCr(long long n, long long r) {
  long long x = 1, y = 1;
  for (long long i = 0; i < r; i++) {
    x = x * (n - i) % 1000000007;
    y = y * (i + 1) % 1000000007;
  }
  return x * powmod(y, 1000000007 - 2) % 1000000007;
}
long long dh[4] = {1, 0, -1, 0};
long long dw[4] = {0, 1, 0, -1};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M + 1);
  vector<long long> dist(M + 1);
  for (long long i = 1; i <= long long(M); i++) {
    cin >> a[i];
  }
  a[0] = 0;
  for (long long i = 0; i < long long(M); i++) {
    dist[i] = a[i + 1] - a[i] - 2;
    if (i != 0 && a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  dist[0]++;
  dist[M] = N - a[M] - 1;
  vector<long long> res(N + 5, 0);
  res[0] = 1;
  res[1] = 1;
  res[2] = 2;
  for (long long i = 1; i <= long long(N); i++) {
    res[i + 2] = res[i + 1] + res[i];
  }
  long long ans = 1;
  for (auto d : dist) {
    if (d == 0) continue;
    ans *= res[d] % 1000000007;
    ans %= 1000000007;
  }
  ans %= 1000000007;
  if (ans < 0) ans += 1000000007;
  cout << ans << endl;
  return 0;
}
