#include <bits/stdc++.h>
using namespace std;
const unsigned int mod = 1000000000 + 7;
unsigned int fib(unsigned int n) {
  unsigned int cur = 1, next = 1;
  for (unsigned int i = 0; i < n; ++i) {
    unsigned int tmp = cur;
    cur = next;
    next += tmp;
  }
  return cur;
}
int main() {
  unsigned int N, M;
  cin >> N >> M;
  vector<unsigned int> A(M);
  for (int i = 0; i < M; ++i) {
    cin >> A[i];
  }
  unsigned int ans = 1;
  unsigned int cur = 0;
  for (int i = 0; i < M; ++i) {
    if (i == 0)
      ans *= (fib(A[i] - cur - 1) % mod);
    else
      ans *= (fib(A[i] - cur - 2) % mod);
    ans %= mod;
    cur = A[i];
    if (i != M - 1 && A[i] + 1 == A[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  ans *= (fib(N - cur - 1) % mod);
  ans %= mod;
  cout << ans << endl;
}
