#include <bits/stdc++.h>
using namespace std;
const int maxn = 3010;
long long f[maxn][maxn];
int lcp[maxn][maxn];
const long long mod = 1e9 + 7;
int n;
int s[maxn];
int b[maxn];
void add(long long &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (s[i] == s[j]) lcp[i][j] = lcp[i - 1][j - 1] + 1;
    }
  }
  for (int i = 4; i <= n; i++) {
    for (int j = i - 3; j <= i; j++) {
      b[i] = b[i] << 1 | s[j];
    }
  }
  for (int i = 1; i <= n; i++) {
    f[i][i - 1] = 1;
    for (int j = i; j <= n; j++) {
      for (int k = 1; k <= 3; k++) {
        if (j - k >= i - 1) add(f[i][j], f[i][j - k]);
      }
      if (i + 2 < j && b[j] != 3 && b[j] != 5 && b[j] != 14 && b[j] != 15)
        add(f[i][j], f[i][j - 4]);
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int t = 0;
    for (int j = 1; j < i; j++) t = max(t, lcp[i][j]);
    for (int k = t; k < i; k++) add(ans, f[i - k][i]);
    cout << ans << '\n';
  }
  return 0;
}
