#include <bits/stdc++.h>
using namespace std;
long long gcd(long long, long long);
vector<bool> to_binary(int);
int sum(vector<int>);
int min(vector<int>);
int max(vector<int>);
long long nCr(int n, int r) {
  long long ln = (long long)n;
  long long lr = (long long)r;
  long long res = 1;
  for (int count = 0; count < lr; count++) {
    res *= ln;
    res %= 1000000007;
    ln--;
  }
  for (int count = 1; count <= lr; count++) res /= count;
  return res % 1000000007;
}
long long get_route(int n) {
  if (n <= 0) return 0;
  if (n == 1) return 1;
  int res = 1;
  for (int c = 1; c <= n / 2; c++) {
    res += nCr(n - c, c);
  }
  return res;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 2);
  a[0] = 0;
  for (long long i = 0; i < (long long)M; i++) cin >> a[i + 1];
  a[M + 1] = N;
  long long ans = 1;
  for (int i = 0; i < M + 1; i++) {
    if (i == 0 && a[i + 1] == 1)
      ans *= 1;
    else
      ans *= get_route(a[i + 1] - a[i] - 1);
    cout << ans << endl;
    ans %= 1000000007;
  }
  cout << ans << endl;
ProgramEndPointLabel:;
  system("pause");
  return 0;
}
int sum(vector<int> v) {
  int res = 0;
  for (auto it = v.begin(); it != v.end(); it++) res += *it;
  return res;
}
int min(vector<int> v) {
  int min = INT32_MAX;
  for (auto it = v.begin(); it != v.end(); it++) min = std::min(min, *it);
  return min;
}
int max(vector<int> v) {
  int max = 0;
  for (auto it = v.begin(); it != v.end(); it++) max = std::max(max, *it);
  return max;
}
long long gcd(long long A, long long B) {
  int r = A % B;
  while (r != 0) {
    A = B;
    B = r;
    r = A % B;
  }
  return B;
}
vector<bool> to_binary(int x) {
  vector<bool> res;
  while (x != 0) {
    res.push_back(x % 2);
    x /= 2;
  }
  return res;
}
