#include <bits/stdc++.h>
using namespace std;
const int MAXM = 3010;
const int MOD = 1e9 + 7;
int add(int a, int b) { return ((long long)a + b + MOD) % MOD; }
int m;
int a[MAXM];
void load() {
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%d", a + i);
}
int f[MAXM][MAXM];
int g[MAXM][MAXM];
int sol[MAXM];
void solve() {
  reverse(a, a + m);
  int dp[4][2];
  for (int i = 0; i < m; i++) {
    int t = i & 1;
    dp[1][t] = f[i][i] = 1;
    dp[2][t] = dp[3][t] = 0;
    g[i][i] = 1;
    for (int j = i + 1; j < m; j++) {
      t = j & 1;
      dp[1][t] = f[i][j - 1];
      dp[2][t] = dp[1][t ^ 1];
      dp[3][t] = dp[2][t ^ 1];
      f[i][j] = add(add(dp[1][t], dp[2][t]), dp[3][t]);
      if (j - i >= 3) {
        int x = a[j] + (a[j - 1] << 1) + (a[j - 2] << 2) + (a[j - 3] << 3);
        if (x != 12 && x != 10 && x != 7 && x != 15)
          f[i][j] = add(f[i][j], dp[3][t ^ 1]);
      }
      g[i][j] = add(g[i][j - 1], f[i][j]);
    }
  }
  for (int i = 0; i < m; i++) sol[0] = add(sol[0], g[i][m - 1]);
  list<pair<int, int> > L;
  for (int i = 0; i < m; i++) L.push_back(pair<int, int>(i, 0));
  L.sort([](const pair<int, int> &x, const pair<int, int> &y) -> bool {
    int px = x.first, py = y.first;
    while (px < m && py < m && a[px] == a[py]) px++, py++;
    if (px == m) return true;
    if (py == m) return false;
    return a[px] < a[py];
  });
  int sub = 0;
  for (auto it = L.begin(); it != L.end(); it++) {
    auto nit = next(it);
    if (nit != L.end()) {
      int px = it->first, py = nit->first;
      while (px < m && py < m && a[px] == a[py]) px++, py++;
      it->second = px;
      if (px != it->first) sub = add(sub, g[it->first][px - 1]);
    }
  }
  sol[0] = add(sol[0], -sub);
  for (int i = 0; i < m - 1; i++) {
    auto it = L.begin();
    for (; it != L.end(); it++)
      if (it->first == i) break;
    sol[i + 1] = add(sol[i], -g[i][m - 1]);
    if (next(it) != L.end() && it->second != it->first)
      sol[i + 1] = add(sol[i + 1], g[it->first][it->second - 1]);
    if (it != L.begin()) {
      auto pit = prev(it);
      if (pit->first != pit->second)
        sol[i + 1] = add(sol[i + 1], g[pit->first][pit->second - 1]);
      it = L.erase(it);
      if (it != L.end()) {
        int px = pit->first, py = it->first;
        while (px < m && py < m && a[px] == a[py]) px++, py++;
        pit->second = px;
        if (px != pit->first)
          sol[i + 1] = add(sol[i + 1], -g[pit->first][px - 1]);
      }
    } else {
      L.erase(it);
    }
  }
  for (int i = m - 1; i >= 0; i--) printf("%d\n", sol[i]);
}
int main() {
  load();
  solve();
  return 0;
}
