#include <bits/stdc++.h>
using namespace std;
vector<int> memo(100010, -1);
int p = pow(10, 9) + 7;
int func(int i) {
  if (i == -1) return 0;
  if (i <= 1) return 1;
  if (memo[i] != -1) return memo[i];
  return memo[i] = (func(i - 1) % p + func(i - 2) % p) % p;
}
int main() {
  int N, M, a[100010];
  long long da[100010];
  cin >> N >> M >> a[0];
  da[0] = a[0] - 1;
  for (int i = 1; i < M; ++i) {
    cin >> a[i];
    da[i] = a[i] - a[i - 1] - 2;
  }
  da[M] = N - a[M - 1] - 1;
  long long x = 1;
  for (int m = 0; m <= M; ++m) {
    x = (x * func(da[m])) % p;
  }
  cout << x << endl;
  return 0;
}
