#include <bits/stdc++.h>
using namespace std;
int main() {
  uint32_t N, M, *a, *P;
  cin >> N >> M;
  a = new uint32_t[M];
  for (uint32_t i = 0; i < M; ++i) cin >> a[i];
  P = new uint32_t[N + 2];
  P[0] = 1;
  P[1] = 1;
  for (uint32_t i = 0; i < N; ++i) P[i + 2] = P[i] + P[i + 1];
  uint32_t Cur = 0;
  uint64_t res = 1;
  for (uint32_t i = 0; i < M; ++i) {
    if (Cur == a[i]) {
      res *= 0;
      break;
    }
    uint32_t tmp = a[i] - Cur - 1;
    res *= P[tmp];
    Cur = a[i] + 1;
  }
  if (Cur != 0)
    res *= P[N - Cur];
  else
    res *= P[N - Cur + 1];
  cout << res % 1000000007 << endl;
  return 0;
}
