#include <bits/stdc++.h>
using namespace std;
long long patarn(vector<long long> vec, int p) {
  if (p < 0) {
    return 0;
  } else {
    return vec.at(p);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  long long ans = 1;
  vector<long long> vec = {1, 1};
  if (M != 0) {
    int a[M];
    for (int i = 0; i < M; i++) {
      cin >> a[i];
    }
    vector<int> b;
    b.push_back(a[0] - 1);
    if (M > 1) {
      for (int i = 1; i < M; i++) {
        b.push_back(a[i] - a[i - 1] - 2);
      }
    }
    b.push_back(N - a[M - 1] - 1);
    cout << "b" << endl;
    for (int i = 0; i < b.size(); i++) {
      cout << b[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < *max_element(b.begin(), b.end()); i++) {
      vec.push_back(*(vec.end() - 1) + *(vec.end() - 2));
    }
    cout << "vec" << endl;
    for (int i = 0; i < vec.size(); i++) {
      cout << vec.at(i) << " ";
    }
    cout << endl;
    for (int i = 0; i < b.size(); i++) {
      ans *= patarn(vec, b.at(i));
      ans %= ((long long)1000000007);
    }
  } else {
    for (int i = 0; i < N; i++) {
      vec.push_back(*(vec.end() - 1) + *(vec.end() - 2));
    }
    ans = patarn(vec, N);
    ans %= ((long long)1000000007);
  }
  cout << ans;
}
