#include <bits/stdc++.h>
using namespace std;
long long fibo(int n, vector<long long> &memo) {
  if (n == 0)
    return 1;
  else if (n == 1)
    return 1;
  if (memo[n] != -1) return memo[n];
  return memo[n] =
             (fibo(n - 1, memo) + fibo(n - 2, memo)) % (long long)1000000007;
}
int main() {
  vector<long long> memo(100010, -1);
  long long ans = 1;
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  for (int i = 0; i < (m); i++) cin >> v[i];
  vector<int> x(m + 1);
  x[0] = v[0] - 1;
  for (int i = 1; i < (m); i++) {
    x[i] = v[i + 1] - v[i] - 2;
    if (x[i] < 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  x[m] = n - v[m - 1] - 1;
  for (int i = 0; i < (m + 1); i++) {
    ans *= fibo(x[i], memo);
    ans %= 1000000007;
  }
  cout << ans << endl;
}
