#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const long long mod = 1e9 + 7;
long long a[100005];
long long patterns[100005];
void init(long long patterns[], long long N) {
  patterns[0] = 1;
  patterns[1] = 1;
  for (int i = (2); i < (N + 1); i++) {
    patterns[i] = (patterns[i - 1] + patterns[i - 2]) % mod;
  }
}
int main(void) {
  long long N, M;
  cin >> N >> M;
  long long answer = 1;
  init(patterns, N);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = (-1); i < (M); i++) {
    long long idx;
    if (i == -1) {
      idx = a[0] - 1;
    } else if (i == M - 1) {
      idx = N - (a[M - 1] + 1);
    } else {
      idx = (a[i + 1] - 1) - (a[i] + 1);
    }
    if (idx < 0) {
      answer = 0;
      break;
    }
    answer = (answer * patterns[idx]) % mod;
  }
  cout << answer << endl;
  return 0;
}
