#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long N, M;
  cin >> N >> M;
  vector<unsigned long long> a(M + 2);
  a.at(0) = -1;
  if (M != 0)
    for (long long i = 1; i < M + 1; i++) cin >> a.at(i);
  a.at(M + 1) = N + 1;
  vector<unsigned long long> fib(100005);
  fib.at(0) = 0;
  fib.at(1) = 1;
  for (unsigned long long i = 2; i < 100005; i++)
    fib.at(i) = fib.at(i - 1) + fib.at(i - 2);
  vector<unsigned long long> deff(M + 1);
  long long ans = 1;
  for (long long i = 0; i < M + 1; i++) deff.at(i) = a.at(i + 1) - a.at(i) - 1;
  for (long long i = 0; i < M + 1; i++) {
    ans *= fib.at(deff.at(i));
  }
  cout << ans % 1000000007 << endl;
}
