#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int mod = 1e9 + 7, mod2 = 1e9 + 9;
const int base1 = 5, base2 = 3;
int add(int a, int b, int mod) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
int mul(int a, int b, int mod) { return (a * (long long)b) % mod; }
int forbidden[] = {3, 5, 14, 15};
int dp[3000 + 1][3000 + 1];
int m;
int A[3000 + 1];
vector<pair<int, int> > good;
int ans[3 << 10];
bool isForbidden(int len, int x) {
  if (len != 4) return 0;
  return x == 3 || x == 5 || x == 14 || x == 15;
}
int getKthBit(int batIdx, int bit) { return (good[batIdx].second >> bit) & 1; }
bool isInstance(int s, int e, int i) {
  int len = e - s + 1;
  if (len != good[i].first) return 0;
  for (int j = 0; j < len; j++) {
    int b = (good[i].second >> (len - j - 1)) & 1;
    if (A[s + j] != b) return 0;
  }
  return 1;
}
string c2s(int len, int x) {
  string s(len, '0');
  for (int i = 0; i < len; i++) s[i] = ((x >> i) & 1) + '0';
  reverse(s.begin(), s.end());
  return s;
}
int solve(int s, int e) {
  if (s > e) return 1;
  int &ret = dp[s][e];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = 0; i < 26; i++) {
    for (int j = 1; j <= 4 && s + j - 1 <= e; j++)
      if (isInstance(s, s + j - 1, i)) {
        int tmp = solve(s + j, e);
        ret = add(ret, tmp, mod);
      }
  }
  return ret;
}
int trie[3000 * 3000][2];
int siz = 1;
int insert(int e) {
  int ret = 0, cur = 0;
  for (int s = e; s >= 0; s--) {
    if (!trie[cur][A[s]]) {
      trie[cur][A[s]] = siz++;
      ret = add(ret, solve(s, e), mod);
    }
    cur = trie[cur][A[s]];
  }
  return ret;
}
int main(int argc, char **argv) {
  for (int len = 1; len <= 4; len++)
    for (int i = 0; i < (1 << len); i++)
      if (!isForbidden(len, i)) good.push_back(make_pair(len, i));
  scanf("%d", &m);
  for (int i = 0; i < (m); i++) scanf("%d", A + i);
  memset(dp, -1, sizeof dp);
  unordered_set<long long> S;
  int ans = 0;
  for (int e = 0; e < m; e++) {
    ans = add(ans, insert(e), mod);
    printf("%d\n", ans);
  }
  return 0;
}
