#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXLEN = 3000;
const int MOD = 1000000007;
void inc(int &a, int b) {
  if ((a += b) >= MOD) a -= MOD;
}
struct TNode {
  int c[2];
  bool alive;
  int dp;
};
int len;
char s[MAXLEN + 1];
int ans[MAXLEN];
vector<TNode> nodes;
int root;
int addnode() {
  TNode node;
  node.c[0] = node.c[1] = -1;
  node.alive = false;
  node.dp = 0;
  int ret = ((int)(nodes).size());
  nodes.push_back(node);
  return ret;
}
int pos[MAXLEN];
void solve() {
  nodes.clear();
  root = addnode();
  for (int i = (0); i < (len); ++i) {
    int at = root;
    for (int j = (i); j < (len); ++j) {
      int x = s[j] - '0';
      if (nodes[at].c[x] == -1) {
        int to = addnode();
        nodes[at].c[x] = to;
      }
      at = nodes[at].c[x];
    }
  }
  nodes[root].dp = 1;
  for (int i = (0); i < (((int)(nodes).size())); ++i) {
    for (int clen = (1); clen <= (4); ++clen)
      for (int cmask = (0); cmask < (1 << clen); ++cmask) {
        if (clen == 4 &&
            (cmask == 12 || cmask == 10 || cmask == 7 || cmask == 15))
          continue;
        int at = i;
        for (int j = (0); j < (clen); ++j) {
          int x = (cmask >> j) & 1;
          at = at == -1 ? -1 : nodes[at].c[x];
        }
        if (at != -1) inc(nodes[at].dp, nodes[i].dp);
      }
  }
  int total = 0;
  for (int i = (0); i < (len); ++i) {
    pos[i] = root;
    for (int j = (0); j <= (i); ++j) {
      int at = pos[j], x = s[i] - '0', to = nodes[at].c[x];
      assert(to != -1);
      pos[j] = to;
      if (!nodes[to].alive) {
        nodes[to].alive = true;
        inc(total, nodes[to].dp);
      }
    }
    ans[i] = total;
  }
}
void run() {
  scanf("%d", &len);
  for (int i = (0); i < (len); ++i) scanf(" %c", &s[i]);
  s[len] = '\0';
  solve();
  for (int i = (0); i < (len); ++i) printf("%d\n", ans[i]);
}
int main() {
  run();
  return 0;
}
