#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> broken(M + 2);
  broken.at(0) = 0;
  broken.at(M + 1) = N;
  for (int i = 1; i < M + 1; i++) {
    cin >> broken.at(i);
  }
  vector<int> walk(M + 1);
  vector<long long> fibo(100002);
  fibo.at(0) = 0;
  fibo.at(1) = 1;
  fibo.at(2) = 2;
  for (int i = 1; i < 100000; i++) {
    fibo.at(i + 2) = fibo.at(i) % 1000000007 + fibo.at(i + 1) % 1000000007;
    fibo.at(i + 2) %= 1000000007;
  }
  for (int i = 0; i < M + 1; i++) {
    walk.at(i) = broken.at(i + 1) - broken.at(i) - 2;
    if (walk.at(i) == -1) {
      walk.at(i) = 0;
    }
  }
  walk.at(0)++;
  walk.at(M)++;
  int64_t sum = 1;
  for (int i = 0; i < M + 1; i++) {
    sum *= fibo.at(walk.at(i));
    sum %= 1000000007;
  }
  cout << sum << endl;
}
