#include <bits/stdc++.h>
using namespace std;
const int maxN = 3042, mod = 1000000007;
const int modHash = 2013023017;
inline void add_mod(long long& a, long long b) { a = (a + b) % mod; }
inline void mult_mod(long long& a, long long b) { a = a * b % mod; }
long long dp[maxN][maxN], pref[maxN];
unordered_set<long long> S[maxN];
bool fld[42];
int in[maxN];
int main() {
  fld[12] = fld[10] = fld[7] = fld[15] = true;
  int n;
  scanf("%d", &n);
  for (int i = 1; i < (n + 1); i++) scanf("%d", in + i);
  for (int i = 1; i < (n + 1); i++) {
    int mask = 0;
    long long H[10];
    H[3] = H[5] = 0;
    dp[i][i - 1] = 1;
    for (int j = i; j < (n + 1); j++) {
      H[3] = (H[3] * 3 + in[j] + 1) % modHash;
      H[5] = (H[5] * 5 + in[j] + 1) % modHash;
      mask >>= 1;
      mask |= in[j] << 3;
      int len = j - i + 1;
      dp[i][j] = (len >= 4 and !fld[mask]) ? dp[i][j - 4] : 0;
      for (int k = 1; k < (min(4, len + 1)); k++) dp[i][j] += dp[i][j - k];
      dp[i][j] %= mod;
      long long M = H[3] << 32 | H[5];
      if ((S[len].insert(M)).second) pref[j] += dp[i][j];
    }
  }
  long long sum = 0;
  for (int i = 1; i < (n + 1); i++) {
    add_mod(sum, pref[i]);
    printf("%lld\n", sum);
  }
  return 0;
}
