#include <bits/stdc++.h>
using namespace std;
int fibo(int n) {
  if (n < 0) return 0;
  if (n == 0) return 1;
  if (n == 1) return 1;
  return fibo(n - 1) + fibo(n - 2);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin >> A[i];
  A.push_back(N + 1);
  vector<int> memo(N);
  int i = 0;
  while (i <= N) {
    if (i == 0) memo[0] = 1;
    if (i == 1) memo[1] = 1;
    if (i > 1) memo[i] = memo[i - 1] + memo[i - 2];
    i++;
  }
  long long ans = 1;
  int dist = A[0] - 1;
  ans *= memo[dist];
  ans %= 1000000007;
  for (int i = 0; i < M; i++) {
    dist = A[i + 1] - A[i] - 2;
    ans *= memo[dist];
    ans %= 1000000007;
  }
  cout << ans << endl;
}
