#include <bits/stdc++.h>
using namespace std;
const int N = 3005, M = N * N, MOD = 1e9 + 7;
int a[N], to[M][2], b[M], dp[M], av[M], ae[M], q[N];
bool ban[1 << 4];
int z = 1;
void f(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
void dfs(int node) {
  for (int i = 0, j = node, x = 0; i < 4; i++) {
    if (j == 0) break;
    x = (x << 1) | ae[j];
    j = av[j];
    if (i != 3 || !ban[x]) {
      f(dp[node], dp[j]);
    }
  }
  if (node) f(q[b[node]], dp[node]);
  for (int i = 0; i < 2; i++) {
    if (to[node][i] != -1) {
      dfs(to[node][i]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(to, -1, sizeof(to));
  int m;
  cin >> m;
  ban[12] = 1;
  ban[10] = 1;
  ban[7] = 1;
  ban[15] = 1;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    int v = 0;
    for (int j = i; j < m; j++) {
      if (to[v][a[j]] == -1) {
        ae[z] = a[j];
        av[z] = v;
        b[z] = j;
        to[v][a[j]] = z++;
      }
      v = to[v][a[j]];
    }
  }
  dp[0] = 1;
  dfs(0);
  for (int i = 0; i < m; i++) {
    f(q[i + 1], q[i]);
    cout << q[i] << "\n";
  }
  return 0;
}
