#include <bits/stdc++.h>
const int N = 3000 + 10;
const int N2 = N * N;
const int MOD = 1e9 + 7;
int n;
int a[N];
int f[N2];
int fa[N2];
int ch[N2][2], nodecnt;
int tcnt[N2];
int ans[N];
inline int qmod(int x) { return (x >= MOD) ? (x - MOD) : x; }
void dfs(int p) {
  int i, x, anc;
  if (!p) return;
  for (anc = p, x = i = 0; anc and i < 4; i++, anc = fa[anc]) {
    x = x | ((ch[fa[anc]][1] == anc) << i);
    if (i == 3 and (x == 3 or x == 5 or x == 14 or x == 15)) break;
    f[p] = qmod(f[p] + f[fa[anc]]);
  }
  dfs(ch[p][0]);
  dfs(ch[p][1]);
}
int main() {
  int i, j, p;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  fa[0] = -1;
  for (i = 1; i <= n; i++) {
    p = 0;
    for (j = i; j <= n; j++) {
      if (!ch[p][a[j]]) {
        ch[p][a[j]] = ++nodecnt;
        fa[nodecnt] = p;
        tcnt[nodecnt] = j;
      }
      p = ch[p][a[j]];
    }
  }
  f[0] = 1;
  dfs(ch[0][0]);
  dfs(ch[0][1]);
  for (i = 1; i <= nodecnt; i++)
    ans[tcnt[i]] = (0LL + ans[tcnt[i]] + f[i]) % MOD;
  for (i = 1; i <= n; i++) printf("%d\n", ans[i] = qmod(ans[i] + ans[i - 1]));
  return 0;
}
