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