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