#include <bits/stdc++.h>
using namespace std;
int fib(int a) {
  int i, f0, f1, f2;
  f0 = 1;
  f1 = 1;
  i = 2;
  while (i <= a) {
    f2 = f1;
    f1 = f0;
    f0 = f1 + f2;
    i++;
  }
  return f0;
}
int main() {
  int N, M, i, last, mod;
  unsigned long long sum;
  cin >> N >> M;
  if (M == 0) {
    cout << fib(N) << endl;
    return 0;
  }
  double A[M + 1];
  for (i = 0; i < M; i++) {
    cin >> A[i];
  }
  A[M] = A[M - 1] + 2;
  mod = pow(10, 9) + 7;
  sum = fib(A[0] - 0);
  last = A[0];
  for (i = 1; i < M; i++) {
    if (A[i + 1] - A[i] > 1) {
      sum *= fib(A[i] - last - 1);
      last = A[i];
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  sum *= fib(N - last);
  cout << sum % mod << endl;
  return 0;
}
