#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, isPossible = 1, mod = 1000000007;
  unsigned long long sum = 0;
  cin >> N >> M;
  vector<unsigned long long> a(M), fib(N);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  if (M >= 2) {
    for (int j = 1; j < M; j++) {
      if (a.at(j) - a.at(j - 1) == 1) {
        isPossible = 0;
        break;
      }
    }
  }
  fib.at(0) = 0;
  if (N >= 2) fib.at(1) = 1;
  if (N >= 3) fib.at(2) = 1;
  if (N >= 4)
    for (int k = 3; k < N; k++) {
      fib.at(k) = fib.at(k - 1) + fib.at(k - 2);
    }
  if (isPossible) {
    sum = 1;
    if (M >= 1) {
      sum = ((sum % mod) * (fib.at(a.at(0)) % mod)) % mod;
    }
    if (M >= 2) {
      for (int l = 1; l < M; l++) {
        sum = ((sum % mod) * (fib.at(a.at(l) - a.at(l - 1) - 1) % mod)) % mod;
      }
    }
    if (M >= 1) sum = ((sum % mod) * (fib.at(N - a.at(M - 1) % mod))) % mod;
    if (M == 0 && N != 1)
      sum = (sum % mod) * ((fib.at(N - 1) + fib.at(N - 2)) % mod) % mod;
  } else {
    sum = 0;
  }
  cout << sum << endl;
}
