#include <bits/stdc++.h>
long long wawa(long long wa);
long long bikuri(long long X);
using namespace std;
int main() {
  int i, j, k;
  int n, m;
  long long ans = 0;
  cin >> n >> m;
  vector<int> a(m + 2);
  a[0] = -1;
  a[m + 1] = n + 1;
  for (i = 1; i <= m; i++) {
    cin >> a[i];
    if (i >= 1) {
      if (a[i - 1] == a[i] - 1) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  for (i = 1; i <= m + 1; i++) {
    cout << (a[i] - 1) - (a[i - 1] + 1) << endl;
    ans += wawa((a[i] - 1) - (a[i - 1] + 1));
  }
  std::cout << ans % 1000000007 << std::endl;
  return 0;
}
long long wawa(long long wa) {
  long long retu = 0;
  for (long long i = wa / 2; i >= 0; i--) {
    long long one = wa - 2 * i;
    retu += (bikuri(one + i)) / (bikuri(one) * bikuri(i));
  }
  return retu;
}
long long bikuri(long long x) {
  long long temp = 1;
  if (x == 0) return 1;
  for (long long i = 1; i <= x; i++) {
    temp *= i;
  }
  return temp;
}
