#include <bits/stdc++.h>
using namespace std;
long long DIV = (long long)1e9 + 7;
long long Fibo[(long long)1e5 + 100];
long long GetFibo(long long id) {
  if (!Fibo[id]) {
    Fibo[id] = (GetFibo(id - 2) + GetFibo(id - 1));
  }
  return Fibo[id];
}
int main(void) {
  long long N, M;
  cin >> N >> M;
  long long A[M];
  for (int i = 0; i < (int)(M); i++) {
    cin >> A[i];
  }
  for (int i = 0; i < (int)(N); i++) Fibo[i] = 0;
  Fibo[0] = 1;
  Fibo[1] = 1;
  Fibo[2] = 2;
  long long ans = 1;
  if (M == 0)
    ans = GetFibo(N - 0);
  else {
    if (A[0] <= 1) ans *= 0;
    if (A[M - 1] == N - 1) ans *= 0;
    ans *= GetFibo(A[0] - 1 - 0) % DIV;
    ans *= GetFibo(N - A[M - 1] - 1) % DIV;
    for (int i = 0; i < (int)(M - 1); i++) {
      if (A[i + 1] - A[i] <= 1)
        ans *= 0;
      else
        ans *= GetFibo(A[i + 1] - A[i] - 2) % DIV;
    }
  }
  cout << ans % DIV << endl;
  return 0;
}
