#include <bits/stdc++.h>
using namespace std;
unsigned long long func(unsigned long long n) {
  if (n == 0) return 1;
  if (n == 1)
    return 1;
  else
    return func(n - 1) + func(n - 2);
}
int main(void) {
  unsigned long long N, M;
  cin >> N >> M;
  unsigned long long a[M];
  for (int(i) = 0; (i) < (M); (i)++) cin >> a[i];
  bool jud = true;
  for (unsigned long long j = 0; j < M - 1; j++) {
    if (a[j + 1] - a[j] == 1) jud = false;
  }
  if (jud) {
    unsigned long long sum = 1;
    sum *= func(a[0] - 1);
    for (unsigned long long t = 1; t < M; t++) {
      sum *= func(a[t] - a[t - 1] - 2);
      sum %= 1000000007;
    }
    sum *= func(N - a[M - 1] - 1);
    sum %= 1000000007;
    cout << sum << endl;
  } else
    cout << 0 << endl;
  return 0;
}
