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