#include <bits/stdc++.h>
using namespace std;
int sum, a[3010], fa[8000000], son[8000000][2], head[3010], nxt[8000000],
    dp[8000000], num[8000000], q[8000000], ans;
void add(int *a, int n, int s) {
  int root = 0, tmp;
  for (int i = 0; i < n; ++i) {
    tmp = a[i];
    if (!son[root][tmp]) {
      son[root][tmp] = ++sum;
      fa[sum] = root;
      num[sum] = tmp;
      nxt[sum] = head[s + i];
      head[s + i] = sum;
    }
    root = son[root][tmp];
  }
}
void cal() {
  int h = 0, t = 0;
  q[h] = 0;
  while (h <= t) {
    int x = q[h], n = num[x], f = x;
    ++h;
    for (int i = 0; i < 3; ++i) {
      f = fa[f];
      if (f == -1) break;
      n = (n << 3) + (n << 1) + num[f];
      dp[x] += dp[f];
      if (dp[x] >= 1000000007) dp[x] -= 1000000007;
    }
    if (f != -1) f = fa[f];
    if (f != -1 && n != 1100 && n != 1010 && n != 111 && n != 1111) {
      dp[x] += dp[f];
      if (dp[x] >= 1000000007) dp[x] -= 1000000007;
    }
    if (son[x][0]) q[++t] = son[x][0];
    if (son[x][1]) q[++t] = son[x][1];
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i) add(a + i, n - i, i);
  dp[0] = 1;
  fa[0] = -1;
  cal();
  for (int i = 0; i < n; ++i) {
    for (int j = head[i]; j; j = nxt[j]) {
      ans += dp[j];
      if (ans >= 1000000007) ans -= 1000000007;
    }
    printf("%d\n", ans);
  }
  return 0;
}
