#include <bits/stdc++.h>
using namespace std;
bitset<3000 + 1> a;
int dp[3000 + 1][3000 + 2];
inline bool ok(bool a, bool b, bool c, bool d) {
  return !(!a && !b && c && d || !a && b && !c && d || a && b && c && !d ||
           a && b && c && d);
}
unsigned long long Hsh[3000 + 1], power[3000 + 1];
unsigned long long hsh(int l, int r) {
  return Hsh[r] - Hsh[l - 1] * power[r - l + 1];
}
int head[10000000], nxt[3000 * 3000], tot;
unsigned long long data[3000 * 3000];
void add(int x, unsigned long long y) {
  data[++tot] = y;
  nxt[tot] = head[x];
  head[x] = tot;
}
int main() {
  int n, ans = 0, i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[i] = x;
  }
  power[0] = 1;
  for (i = 1; i <= n; i++)
    Hsh[i] = Hsh[i - 1] * 131ull + a[i] + 1, power[i] = power[i - 1] * 131ull;
  fill(dp[0] + 1, dp[0] + n + 2, 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j + i - 1 <= n; j++)
      dp[i][j] = dp[i - 1][j + 1], dp[i][j] += i >= 2 ? dp[i - 2][j + 2] : 0,
      dp[i][j] %= 1000000007, dp[i][j] += i >= 3 ? dp[i - 3][j + 3] : 0,
      dp[i][j] %= 1000000007,
      dp[i][j] += i >= 4 && ok(a[j], a[j + 1], a[j + 2], a[j + 3])
                      ? dp[i - 4][j + 4]
                      : 0,
      dp[i][j] %= 1000000007;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= i; j++) {
      unsigned long long h = hsh(j, i);
      int hmod = h % 10000000;
      bool mar = false;
      for (int k = head[hmod]; k; k = nxt[k])
        if (data[k] == h) {
          mar = true;
          break;
        }
      if (!mar) ans += dp[i - j + 1][j], ans %= 1000000007, add(hmod, h);
    }
    printf("%d\n", ans);
  }
  return 0;
}
