#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 1), f(n + 1);
  f.at(1) = 1;
  f.at(2) = 1;
  for (int i = 0; i < (int)(m); i++) {
    cin >> a.at(i);
  }
  a.at(m) = n + 1;
  for (int j = 0; j < (int)(n - 1); j++) {
    f.at(j + 2) = f.at(j + 1) + f.at(j);
  }
  int p = 0;
  long long int b = 1;
  for (int k = 0; k < (int)(m + 1); k++) {
    b *= f.at(a.at(k) - p);
    p = a.at(k) + 1;
  }
  if (a.at(m) == n) {
    b = 0;
  }
  cout << b % 1000000007 << endl;
  return 0;
}
