#include <bits/stdc++.h>
using namespace std;
string s;
char ss[3100];
int n, ans, a[3100], f[3100][3100];
void add(int &x, int k) {
  x += k;
  if (x >= 1000000007) x -= 1000000007;
}
struct SAM {
  int last, tot, son[10000][2], link[10000], len[10000];
  void init() { last = tot = 1; }
  void insert(int c, int k) {
    int cur = ++tot, p;
    len[cur] = len[last] + 1;
    memset(son[cur], 0, sizeof(son[cur]));
    p = last;
    while (p && !son[p][c]) son[p][c] = cur, p = link[p];
    if (!p)
      link[cur] = 1;
    else {
      int q = son[p][c];
      if (len[p] + 1 == len[q])
        link[cur] = q;
      else {
        ++tot;
        for (int i = 0; i < 2; i++) son[tot][i] = son[q][i];
        link[tot] = link[q];
        len[tot] = len[p] + 1;
        while (p && son[p][c] == q) son[p][c] = tot, p = link[p];
        link[q] = link[cur] = tot;
      }
    }
    last = cur;
    for (int i = 1; i <= k - len[link[last]]; i++) add(ans, f[i][k]);
  }
} S;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ss[i] = '0' + a[i];
    f[i][i - 1] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j + i - 1 <= n; j++)
      for (int k = 1; k <= 4; k++)
        if (i >= k) {
          if (k == 4) {
            s = ss[j + i - 4];
            s += ss[j + i - 3];
            s += ss[j + i - 2];
            s += ss[j + i - 1];
            if (s == "0011" || s == "0101") continue;
            if (s == "1110" || s == "1111") continue;
          }
          add(f[j][j + i - 1], f[j][j + i - 1 - k]);
        }
  S.init();
  for (int i = 1; i <= n; i++) {
    S.insert(a[i], i);
    printf("%d\n", ans);
  }
  return 0;
}
