#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) { return (a % b == 0 ? b : gcd(b, a % b)); }
int64_t lcm(int a, int b) { return (int64_t)a * b / gcd(a, b); }
int factorial(int a) {
  int b = 1;
  while (a) {
    b *= a--;
  }
  return b;
}
bool is_prime(int a) {
  if (a <= 1) return false;
  for (int i = 2; (int64_t)i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
int get_adp(double x, int n) {
  return (int)round((x - (int)x) * pow(10, n)) % 10;
}
int64_t sigma(int64_t s, int64_t n) { return n * (2 * s + n - 1) / 2; }
int main() {
  int n, m, a, b = 0, index = 0, times = 1;
  int64_t r = 1000000007, fib = 1, fib_b = 1, temp, ans = 1;
  cin >> n >> m;
  vector<int> vec;
  if (m >= 1) {
    cin >> b;
    vec.push_back(max(1, b - 1));
  }
  for (int i = 1; i < m; i++) {
    cin >> a;
    vec.push_back(max(1, a - b - 2));
    if (a - b == 1) {
      cout << 0 << endl;
      return (0);
    }
    b = a;
  }
  vec.push_back(max(1, n - b - 1));
  sort(vec.begin(), vec.end());
  while (index <= m) {
    if (times == vec[index]) {
      ans = ans * fib % r;
      index++;
    } else {
      temp = fib;
      fib = (fib + fib_b) % r;
      fib_b = temp;
      times++;
    }
  }
  cout << ans << endl;
}
