#include <bits/stdc++.h>
using namespace std;

//フィボナッチ数 mod p
vector<long long> fibmemo(100000, 0);
long long fib(long long n, long long p) {
  if (n == 0) return 0;
  if (n == 1) return 1;
  if (2 <= n && n <= 99999 && fibmemo.at(n) != 0)
    return fibmemo.at(n);
  if (2 <= n && n <= 99999)
    fibmemo.at(n) = (fib(n - 1, p) + fib(n - 2, p)) % p;
  return fibmemo.at(n);
}

int main() {
  long long n, m, p = 1000000007;
  cin >> n >> m;
  vector<long long> a(m), b(1, 0);
  for (long long i = 0; i < m; i++) {
    cin >> a.at(i);
    if (i > 0 && a.at(i) = a.at(i - 1) + 1) {
      cout << 0 << endl;
      return 0;
    }
    b.push_back(a.at(i) + 1);
  }
  b.push_back(n + 2);
  long long cnt = 1;
  for (long long i = 0; i < m + 1; i++)
    cnt *= fib(b.at(i + 1) - 1 - b.at(i), p);
    cnt %= p;
  cout << cnt << endl;
}