#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n, m, b, c, d = 0, x = 0, total = 1, z;
  cin >> n >> m;
  vector<int> a(m + 1);
  cin >> z;
  if (z == 1) {
    a[0] = 1;
  } else {
    a[0] = z - 1;
  }
  b = z;
  for (int i = 1; i < m; i++) {
    cin >> c;
    a[i] = c - b - 2;
    x = max(x, c - b - 1);
    b = c;
  }
  a[m] = n - b - 1;
  sort(a.begin(), a.end(), std::greater<int>());
  vector<int> f(a[0]);
  f[0] = 0;
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i < a[0] + 1; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  for (int h = 0; h < m + 1; h++) {
    total = (total * f[a[h]]) % 1000000007;
  }
  cout << total << endl;
}
