#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T>
inline void chkmin(T &x, T y) {
  if (y < x) x = y;
}
template <typename T>
inline void chkmax(T &x, T y) {
  if (y > x) x = y;
}
template <typename T>
inline T add(T x, T y) {
  return (x + y) % 1000000007;
}
template <typename T>
inline T mul(T x, T y) {
  return 1LL * x * y % 1000000007;
}
template <typename T>
inline T qp(T x, T n) {
  T ans = 1;
  do {
    if (n & 1) ans = mul(ans, x);
    x = mul(x, x);
  } while (n >>= 1);
  return ans;
}
const int SZ = 1 << 13;
char buff[SZ], *pos = buff + SZ - 1;
inline long long read() {
  long long x = 0;
  int f = 1,
      c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos);
  for (; !isdigit(c);
       c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos))
    if (c == '-') f = -f;
  for (; isdigit(c);
       c = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos))
    x = (x << 3) + (x << 1) + (c ^ 48);
  return x * f;
}
const int N = 3005;
int n;
char s[N];
int dp[N][N];
struct HashSet {
  static const int SZZ = 1926817;
  static const int NN = 9e6;
  unsigned long long val[NN];
  int head[SZZ], nxt[NN];
  int tot;
  bool count(unsigned long long x) {
    int id = x % SZZ;
    for (int e = head[id]; e; e = nxt[e])
      if (val[e] == x) return 1;
    return 0;
  }
  void insert(unsigned long long x) {
    int id = x % SZZ;
    ++tot;
    nxt[tot] = head[id];
    head[id] = tot;
    val[tot] = x;
  }
} st;
bool chk(int i) {
  if (s[i - 3] == '0' && s[i - 2] == '0' && s[i - 1] == '1' && s[i] == '1')
    return 1;
  if (s[i - 3] == '0' && s[i - 2] == '1' && s[i - 1] == '0' && s[i] == '1')
    return 1;
  if (s[i - 3] == '1' && s[i - 2] == '1' && s[i - 1] == '1' && s[i] == '0')
    return 1;
  if (s[i - 3] == '1' && s[i - 2] == '1' && s[i - 1] == '1' && s[i] == '1')
    return 1;
  return 0;
}
int main() {
  n = read();
  for (int i = 0; i < (int)(n); ++i) {
    s[i] = (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos);
    (++pos == buff + SZ ? fread(pos = buff, 1, SZ, stdin), *pos : *pos);
  }
  int ans = 0;
  for (int i = 0; i < (int)(n); ++i) {
    dp[i][i - 1] = 1;
    unsigned long long e = 1, hsh = 0;
    for (int j = i; ~j; --j) {
      hsh += e * s[j];
      e *= 19260817;
      for (int k = 1; k <= 4 && i - k + 1 >= j; ++k) {
        if (k == 4 && chk(i)) continue;
        dp[j][i] = add(dp[j][i], dp[j][i - k]);
      }
      if (!st.count(hsh)) {
        st.insert(hsh);
        ans = add(ans, dp[j][i]);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
