#include <bits/stdc++.h>
using namespace std;
int fibo(int n) {
  if (n < 0) return 0;
  if (n == 0) return 1;
  if (n == 1) return 1;
  return fibo(n - 1) + fibo(n - 2);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin >> A[i];
  A.push_back(N + 1);
  long long ans = 1;
  int dist = A[0] - 1;
  cout << fibo(dist) << endl;
  ans *= fibo(dist);
  ans %= 1000000007;
  for (int i = 0; i < M; i++) {
    dist = A[i + 1] - A[i] - 2;
    cout << fibo(dist) << endl;
    ans *= fibo(dist);
    ans %= 1000000007;
  }
  cout << ans << endl;
}
