#include <bits/stdc++.h>
using namespace std;
int fib(int a) { return a == 0 ? 0 : a == 1 ? 1 : fib(a - 1) + fib(a - 2); }
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) % mod;
      last = A[i];
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  sum *= fib(N - last);
  cout << sum % mod << endl;
  return 0;
}
