#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")
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void pre() {}
void solve() {}
int m1, m2;
int a[3009];
long long sc[3009];
const int mod = 1e9 + 7;
long long p[3009];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  pre();
  srand(time(0));
  m1 = rand() % 5000000000 + 5e8, m2 = rand() % 5000000000 + 5e8;
  int n;
  cin >> n;
  vector<pair<pair<pair<int, int>, int>, pair<int, int>>> v;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    long long cur1 = 0, cur2 = 0;
    sc[i + 1] = 1;
    for (int j = i; j >= (0); --j) {
      cur1 = (cur1 * 2 + a[j]) % m1;
      cur2 = (cur2 * 2 + a[j]) % m2;
      sc[j] = 0;
      for (int k = 0; k < (4); ++k) {
        if (i - j >= k) {
          if (k == 3) {
            int lst = 0;
            lst = a[j] * 8 + a[j + 1] * 4 + a[j + 2] * 2 + a[j + 3];
            if (lst == 5 || lst == 14 || lst == 15 || lst == 3) continue;
          }
          sc[j] += sc[j + k + 1];
        }
      }
      sc[j] %= mod;
      v.push_back(make_pair(make_pair(make_pair(cur1, j - i), cur2),
                            make_pair(sc[j], i)));
    }
  }
  sort(v.begin(), v.end());
  p[v[0].second.second] += v[0].second.first;
  for (int i = 1; i <= ((int)(v).size() - 1); ++i) {
    if (v[i].first != v[i - 1].first ||
        v[i].second.first != v[i - 1].second.first)
      p[v[i].second.second] += v[i].second.first;
  }
  p[0] %= mod;
  cout << p[0] << '\n';
  for (int i = 1; i <= (n - 1); ++i) {
    p[i] = (p[i] + p[i - 1]) % mod;
    cout << p[i] << '\n';
  }
  return 0;
}
