#include <bits/stdc++.h>
using namespace std;
const int maxn = 3000;
const long long base = 19260817, P = 1e9 + 7;
long long pw[maxn + 5], ha[maxn + 5];
const long long base2 = 37, P2 = 1e9 + 9;
long long pw2[maxn + 5], ha2[maxn + 5];
int n, s[maxn + 5];
long long f[maxn + 5][maxn + 5], ans[maxn + 5];
set<pair<long long, long long>> Set;
const int md = 1e9 + 7;
inline void Add(long long &a, long long b) {
  a += b;
  if (a >= md) a -= md;
}
bool Chk(int k) {
  if (s[k - 3] == 0 && s[k - 2] == 0 && s[k - 1] == 1 && s[k] == 1)
    return false;
  if (s[k - 3] == 0 && s[k - 2] == 1 && s[k - 1] == 0 && s[k] == 1)
    return false;
  if (s[k - 3] == 1 && s[k - 2] == 1 && s[k - 1] == 1 && s[k] == 0)
    return false;
  if (s[k - 3] == 1 && s[k - 2] == 1 && s[k - 1] == 1 && s[k] == 1)
    return false;
  return true;
}
int main() {
  pw[0] = pw2[0] = 1;
  for (int i = 1; i <= maxn; ++i) {
    pw[i] = pw[i - 1] * base % P;
    pw2[i] = pw2[i - 1] * base2 % P2;
  }
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", s + i);
    ha[i] = (ha[i - 1] * base + s[i]) % P;
    ha2[i] = (ha2[i - 1] * base2 + s[i]) % P2;
  }
  for (int i = 1; i <= n; ++i) {
    for (int k = i; k <= n; ++k) {
      for (int t = 1; t <= 3; ++t)
        if (k - t >= i - 1) Add(f[i][k], (k - t >= i) ? f[i][k - t] : 1);
      if (k - 4 >= i - 1 && Chk(k))
        Add(f[i][k], (k - 4 >= i) ? f[i][k - 4] : 1);
    }
  }
  for (int l = 1; l <= n; ++l) {
    Set.clear();
    for (int i = 1, k = l; k <= n; ++i, ++k) {
      long long tmp = (ha[k] - ha[i - 1] * pw[l] % P + P) % P;
      long long tmp2 = (ha2[k] - ha2[i - 1] * pw2[l] % P2 + P2) % P2;
      if (Set.find(pair<long long, long long>(tmp, tmp2)) != Set.end())
        continue;
      Set.insert(pair<long long, long long>(tmp, tmp2));
      Add(ans[k], f[i][k]);
    }
  }
  for (int i = 1; i <= n; ++i) {
    Add(ans[i], ans[i - 1]);
    printf("%lld\n", ans[i]);
  }
  return 0;
}
