#include <bits/stdc++.h>
using namespace std;
int step(long long int a) {
  double step, b = (1 + sqrt(5)) / 2, c = (1 - sqrt(5)) / 2;
  step = (1 / sqrt(5)) * (pow(b, a + 1) - pow(c, a + 1));
  return step;
}
int main() {
  long long int sum = 1, n, m;
  cin >> n >> m;
  long long int a[m], l[m + 1];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  l[0] = a[0] - 1;
  l[m] = n - a[m - 1] - 1;
  for (int i = 1; i < m; i++) {
    if (a[i] - a[i - 1] != 0)
      l[i] = a[i] - a[i - 1] - 2;
    else
      l[i] = 0;
  }
  if (l[0] == 0) l[0] = 1;
  if (l[m] == 0) l[m] = 1;
  for (int i = 0; i < m + 1; i++) {
    sum = (sum * (step(l[i] % 1000000007))) % 1000000007;
    cout << sum << endl;
  }
  cout << sum << endl;
}
