#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using edge = struct {
  int to;
  long long cost;
};
template <class t, class u>
void chmax(t& a, u b) {
  if (a < b) a = b;
}
template <class t, class u>
void chmin(t& a, u b) {
  if (b < a) a = b;
}
int n, m;
long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> a(m);
  vector<long long> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    a[i] = a[i];
  }
  for (int i = 0; i < n + 1; ++i) {
    dp[i] = 1;
  }
  for (int i = 0; i < m; ++i) {
    cout << a[i] << endl;
  }
  for (int i = 0; i < m; ++i) {
    dp[a[i]] = -1;
  }
  if (dp[1] == -1) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  for (int i = 2; i < n + 1; i++) {
    if (dp[i] == -1) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
    if (dp[i] > mod) {
      dp[i] = dp[i] % mod;
    }
  }
  cout << dp[n] << endl;
  for (int i = 0; i < n + 1; ++i) {
    cout << dp[i] << endl;
  }
}
