#include <bits/stdc++.h>
using namespace std;
int main(void) {
  vector<long long> fib(100000);
  for (long long i = 0; i < 100000; i++) {
    if (i == 0)
      fib.at(0) = 1;
    else if (i == 1)
      fib.at(1) = 1;
    else
      fib.at(i) = (fib.at(i - 1) + fib.at(i - 2)) % 1000000007;
  }
  long long N, M, ans = 1;
  cin >> N >> M;
  if (M == 0) {
    cout << fib.at(N) << endl;
    return 0;
  }
  vector<long long> broken(M), ret(M + 1);
  for (long long i = 0; i < M; i++) cin >> broken.at(i);
  for (long long i = 0; i < M + 1; i++) {
    if (i == 0)
      ret.at(0) = broken.at(0) - 1;
    else if (i == M)
      ret.at(M) = N - broken.at(M - 1) - 1;
    else {
      ret.at(i) = broken.at(i) - broken.at(i - 1) - 2;
      if (ret.at(i) == -1) {
        cout << 0 << endl;
        return 0;
      } else if (ret.at(i) == -2)
        ret.at(i) = 0;
    }
  }
  for (long long i = 0; i < 100000; i++) {
    if (i == 0)
      fib.at(0) = 1;
    else if (i == 1)
      fib.at(1) = 1;
    else
      fib.at(i) = (fib.at(i - 1) + fib.at(i - 2)) % 1000000007;
  }
  for (long long i = 0; i < M + 1; i++)
    ans = (ans * fib.at(ret.at(i))) % 1000000007;
  cout << ans << endl;
  return 0;
}
