#include <bits/stdc++.h>
using namespace std;
int fib(int N) {
  if (N == 0) {
    return 1;
  } else if (N <= 2) {
    return N;
  } else {
    int num1 = 1, num2 = 1, tmp = 1;
    for (int i = 1; i < N; i++) {
      tmp = num1 + num2;
      num1 = num2;
      num2 = tmp;
    }
    return tmp;
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  int danger = 0;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
    if (i >= 1 && a.at(i) - a.at(i - 1) == 1) {
      danger = 1;
    }
  }
  if (danger == 1) {
    cout << 0 << endl;
  } else {
    long sum = 1;
    for (int i = 0; i < M; i++) {
      if (i == 0) {
        sum = fib(a.at(i) - 1);
      } else {
        sum *= fib(a.at(i) - a.at(i - 1) - 2);
      }
    }
    sum *= fib(N - a.at(M - 1) - 1);
    cout << sum % 1000000007 << endl;
  }
}
