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