#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int64_t A[N + 1];
  int B[M];
  for (int i = 0; i < M; i++) cin >> B[i];
  A[0] = 0;
  A[1] = 0;
  A[2] = 1;
  A[3] = 1;
  for (int i = 4; i < N; i++) {
    A[i] = (A[i - 1] + A[i - 2]) % 1000000007;
  }
  int ans = A[B[0] + 1] * A[N - B[M - 1] + 1] % 1000000007;
  for (int i = 1; i < M; i++) {
    ans = ans * A[B[i] - B[i - 1]] % 1000000007;
  }
  cout << ans << endl;
}
