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