#include <bits/stdc++.h>
using namespace std;
int main() {
  int i = 2, k = 1, M, N, count;
  cin >> N >> M;
  vector<int> vec(M + 1);
  vector<int> v(1000000);
  vector<int> x(M + 1);
  v.at(0) = 1;
  v.at(1) = 1;
  while (i < 1000000) {
    v.at(i) = v.at(i - 1) + v.at(i - 2);
    i++;
  }
  for (int j = 0; j < M; j++) {
    cin >> vec.at(j);
  }
  vec.at(M) = N + 1;
  x.at(0) = v.at(vec.at(0) - 1);
  while (k < M + 1) {
    if (vec.at(k) - vec.at(k - 1) == 1) {
      x.at(k) = 0;
    } else {
      x.at(k) = v.at(vec.at(k) - vec.at(k - 1) - 2);
    }
    k++;
  }
  count = x.at(0);
  for (int m = 1; m < M + 1; m++) {
    count *= x.at(m);
  }
  cout << count % 1000000007 << endl;
}
