#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<vector<int>> ch(1, vector<int>(2));
  string s;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    s += c;
  }
  set<string> se = {"0011", "0101", "1110", "1111"};
  vector<long long> f(n + 1);
  for (int i = 0; i < n; i++) {
    int now = 0;
    vector<long long> g(n + 1);
    g[i] = 1;
    for (int j = i; j < n; j++) {
      bool ok = false;
      int x = s[j] - '0';
      if (!ch[now][x]) {
        ch[now][x] = ch.size();
        ch.push_back(vector<int>(2));
        ok = true;
      }
      now = ch[now][x];
      for (int k = 0; k < 4; k++) {
        if (j - k >= 0 && !se.count(s.substr(j - k, k + 1))) {
          g[j + 1] = (g[j + 1] + g[j - k]) % mod;
        }
      }
      if (ok) f[j + 1] = (f[j + 1] + g[j + 1]) % mod;
    }
  }
  for (int i = 1; i <= n; i++) {
    f[i] = (f[i - 1] + f[i]) % mod;
    cout << f[i] << endl;
  }
  return 0;
}
