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