#include <bits/stdc++.h>
using namespace std;
const int MN = 3333, LOG = 14, inf = 1000000005, mod = 999999929,
          MOD = 1000000007;
const long long INF = 1000000000000000005LL;
long long ile[MN][MN];
int kmr[LOG][2 * MN];
int pot[MN], H[MN], pot3[MN], n;
map<string, int> zla;
int bylo[MN][MN], skip[MN][MN];
void licz(int poz) {
  vector<pair<int, int> > P;
  for (int i = 1; i <= n; ++i)
    P.push_back({kmr[poz - 1][i], kmr[poz - 1][i + (1 << (poz - 1))]});
  sort((P).begin(), (P).end());
  for (int i = 1; i <= n; ++i) {
    pair<int, int> cur = {kmr[poz - 1][i], kmr[poz - 1][i + (1 << (poz - 1))]};
    kmr[poz][i] = (int)(lower_bound((P).begin(), (P).end(), cur) - P.begin());
  }
}
pair<int, int> hasz(int i, int j) {
  int len = j - i + 1;
  int wyk = 31 - __builtin_clz(len);
  int pot = (1 << wyk);
  return {kmr[wyk][i], kmr[wyk][j - pot + 1]};
}
int main() {
  zla["1100"] = 1;
  zla["1010"] = 1;
  zla["0111"] = 1;
  zla["1111"] = 1;
  scanf("%d", &n);
  string S = "1";
  for (int i = 1; i <= n; ++i) {
    int co;
    scanf("%d", &co);
    S += ('0' + co);
    kmr[0][i] = co;
  }
  for (int i = 1; i < LOG; ++i) licz(i);
  pot3[0] = 1LL;
  for (int i = 1; i <= n; ++i) {
    pot3[i] = (1LL * pot3[i - 1] * 3) % mod;
    H[i] = ((1LL * H[i - 1] + 1LL * (S[i] - '0' + 1) * pot3[i]) % mod);
  }
  long long res = 0LL;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= n; ++j)
      if (i < j) ile[i][j] = 1LL;
  for (int l = 1; l <= n; ++l)
    for (int i = 1; i + l - 1 <= n; ++i) {
      pair<int, int> h = hasz(i, i + l - 1);
      if (bylo[h.first][h.second] == l) skip[i][i + l - 1] = 1;
      bylo[h.first][h.second] = l;
    }
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j > 0; --j) {
      string cur;
      for (int k = 1; k < 5 && i - k + 1 >= j; ++k) {
        cur += S[i - k + 1];
        if (!zla[cur]) ile[i][j] += ile[i - k][j];
      }
      ile[i][j] %= MOD;
      if (!skip[j][i]) res += ile[i][j];
    }
    res %= MOD;
    printf("%lld\n", res);
  }
}
