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