#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int s[3005];
int dp[3005][3005];
unsigned long long hsh[3005][3005];
unordered_set<unsigned long long> ss[3005];
void Hsh(int n) {
  unsigned long long now;
  for (int i = 1; i <= n; i++) {
    now = 0;
    for (int j = i; j <= n; j++) {
      now = now * 13 + s[j] + 1;
      hsh[i][j] = now;
    }
  }
}
int main() {
  int m, t, now, j, ans;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", &s[i]);
  Hsh(m);
  for (int len = 0; len < m; len++)
    for (int i = 1; i + len <= m; i++) {
      j = i + len;
      if (len < 4) {
        for (int k = 1; k <= len; k++)
          dp[i][j] = (dp[i][j] + dp[i + k][j]) % mod;
        if (len == 3) {
          now = 0;
          for (int k = 0; k < 4; k++) now = now * 2 + s[i + k];
          if (now == 3 || now == 5 || now == 14 || now == 15) continue;
        }
        dp[i][j] = (dp[i][j] + 1) % mod;
      } else {
        now = 0;
        for (int k = 1; k <= 4; k++) {
          now = now * 2 + s[i + k - 1];
          if (k == 4 && (now == 3 || now == 5 || now == 14 || now == 15))
            continue;
          dp[i][j] = (dp[i][j] + dp[i + k][j]) % mod;
        }
      }
    }
  ans = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= i; j++)
      if (!ss[i - j].count(hsh[j][i])) {
        ss[i - j].insert(hsh[j][i]);
        ans = (ans + dp[j][i]) % mod;
      }
    printf("%d\n", ans);
  }
  return 0;
}
