#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int M;
  cin >> N >> M;
  vector<int> vec(M + 2);
  vec.at(0) = -1;
  vec.at(M + 1) = N + 1;
  for (int i = 0; i < M; i++) {
    cin >> vec.at(i + 1);
  }
  vector<int> steps(M + 1);
  for (int i = 0; i < M + 1; i++) {
    steps.at(i) = vec.at(i + 1) - vec.at(i) - 1;
  }
  int mod = 1000000007;
  vector<int> fi(100002);
  fi.at(0) = 0;
  fi.at(1) = 1;
  for (int i = 0; i < 100000; i++) {
    fi.at(i + 2) = fi.at(i + 1) + fi.at(i);
  }
  int count = 1;
  for (int i = 0; i < M + 1; i++) {
    count = ((count % mod) * (fi.at(steps.at(i)) % mod)) % mod;
  }
  cout << count << endl;
}
