#include <bits/stdc++.h>
using namespace std;
int Fibonacci(int n) {
  if (n == 0) {
    return 1;
  }
  if (n == 1) {
    return 1;
  }
  if (n == 2) {
    return 2;
  }
  return Fibonacci(n - 1) + Fibonacci(n - 2);
}
int main() {
  int N;
  int M;
  cin >> N >> M;
  vector<int> data(M);
  for (int i = 0; i < M; i++) {
    cin >> data.at(i);
  }
  int p = data.at(0) - 1;
  long long s = Fibonacci(p);
  for (int i = 0; i < M - 1; i++) {
    int e = data.at(i + 1) - data.at(i) - 2;
    if (e < 0) {
      s *= 0;
    } else {
      s *= Fibonacci(e);
      cout << s << endl;
    }
  }
  int r = N - data.at(M - 1) - 1;
  s *= Fibonacci(r);
  s %= 1000000007;
  cout << s << endl;
}
