#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;
int trie[4500001][2];
int s[3001];
int dp[3001][3001];
char temp[5];
int n, num = 0;
int go(int ed, int o) {
  if (o == ed - 1) return 1;
  if (dp[ed][o] != -1) return dp[ed][o];
  int sum = 0, t = min(o - ed, 2);
  for (int i = 0; i <= t; i++) sum = (sum + go(ed, o - i - 1)) % MOD;
  if (o - ed >= 3) {
    for (int i = 3; i >= 0; i--) temp[3 - i] = s[o - i] + '0';
    if (!strcmp(temp, "0011") || !strcmp(temp, "0101") ||
        !strcmp(temp, "1110") || !strcmp(temp, "1111"))
      ;
    else
      sum = (sum + go(ed, o - 4)) % MOD;
  }
  return dp[ed][o] = sum;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  int sum = 0, now;
  for (int i = 1; i <= n; i++) {
    now = 0;
    for (int j = i; j >= 1; j--) {
      if (!trie[now][s[j]]) {
        trie[now][s[j]] = ++num;
        sum = (sum + go(j, i)) % MOD;
      }
      now = trie[now][s[j]];
    }
    printf("%d\n", sum);
  }
}
