#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int MAXN = 3005;
const long long MOD = 1e9 + 7;
int n, las, tot, deg[MAXN << 1];
long long f[MAXN << 1];
struct sam {
  int fa, to[2];
  int len;
} a[MAXN << 1];
void extend(int c) {
  int p = las, np = ++tot;
  las = np, a[np].len = a[p].len + 1;
  while (p && !a[p].to[c]) a[p].to[c] = np, p = a[p].fa;
  if (!p) {
    a[np].fa = 1;
    return;
  }
  int q = a[p].to[c];
  if (a[p].len + 1 == a[q].len) {
    a[np].fa = q;
    return;
  }
  int nq = ++tot;
  a[nq] = a[q], a[nq].len = a[p].len + 1, a[np].fa = a[q].fa = nq;
  while (p && a[p].to[c] == q) a[p].to[c] = nq, p = a[p].fa;
}
std::queue<int> q;
inline int getnxt(int x, int i, int j) {
  while (i--) {
    x = a[x].to[j & 1];
    if (!x) return 0;
    j >>= 1;
  }
  return x;
}
void solve() {
  memset(f, 0, sizeof f);
  memset(deg, 0, sizeof deg);
  for (register int i = (1); i <= (tot); ++i) {
    if (a[i].to[0]) ++deg[a[i].to[0]];
    if (a[i].to[1]) ++deg[a[i].to[1]];
  }
  while (!q.empty()) q.pop();
  q.push(1);
  f[1] = 1;
  long long ans = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    ans = (ans + f[x]) % MOD;
    for (register int i = (1); i <= (4); ++i) {
      for (register int j = (0); j <= ((1 << i) - 1); ++j) {
        if (i == 4) {
          if (j == 7 || j == 10 || j == 12 || j == 15) continue;
        }
        int ver = getnxt(x, i, j);
        if (!ver) continue;
        f[ver] = (f[ver] + f[x]) % MOD;
      }
    }
    for (register int i = (0); i <= (1); ++i) {
      int ver = a[x].to[i];
      if (!ver) continue;
      --deg[ver];
      if (!deg[ver]) q.push(ver);
    }
  }
  printf("%I64d\n", (ans - 1 + MOD) % MOD);
  return;
}
int main() {
  n = read();
  las = tot = 1;
  for (register int i = (1); i <= (n); ++i) {
    int x = read();
    extend(x);
    solve();
  }
  return 0;
}
