#include <bits/stdc++.h>
using namespace std;
inline void setmin(int &x, int y) {
  if (y < x) x = y;
}
inline void setmax(int &x, int y) {
  if (y > x) x = y;
}
inline void setmin(long long &x, long long y) {
  if (y < x) x = y;
}
inline void setmax(long long &x, long long y) {
  if (y > x) x = y;
}
const int N = 3000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD2 = 998244353;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
inline void add(int &x, int y) {
  x += y;
  if (x >= MOD) {
    x -= MOD;
  }
}
void z_function(string &s, int *z) {
  int n = (int)s.size();
  int l = 0, r = -1;
  for (int i = 1; i < n; i++) {
    z[i] = 0;
    if (i < r) {
      z[i] = min(r - i, z[i - l]);
    }
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) {
      z[i]++;
    }
    if (i + z[i] > r) {
      l = i;
      r = i + z[i];
    }
  }
}
bool check(string &s, int p) {
  if (s[p] == '0' && s[p - 1] == '0' && s[p - 2] == '1' && s[p - 3] == '1') {
    return false;
  }
  if (s[p] == '0' && s[p - 1] == '1' && s[p - 2] == '0' && s[p - 3] == '1') {
    return false;
  }
  if (s[p] == '1' && s[p - 1] == '1' && s[p - 2] == '1' && s[p - 3] == '0') {
    return false;
  }
  if (s[p] == '1' && s[p - 1] == '1' && s[p - 2] == '1' && s[p - 3] == '1') {
    return false;
  }
  return true;
}
int z[N];
int dp[N + 1];
int solve(string s) {
  int n = (int)s.size();
  reverse(s.begin(), s.end());
  z_function(s, z);
  int b = 0;
  for (int i = 0; i < n; i++) {
    setmax(b, z[i]);
  }
  dp[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    dp[i] = 0;
    if (i >= 1) {
      add(dp[i], dp[i - 1]);
    }
    if (i >= 2) {
      add(dp[i], dp[i - 2]);
    }
    if (i >= 3) {
      add(dp[i], dp[i - 3]);
    }
    if (i >= 4 && check(s, i - 1)) {
      add(dp[i], dp[i - 4]);
    }
  }
  int res = 0;
  for (int i = b + 1; i < n + 1; i++) {
    add(res, dp[i]);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  int n;
  cin >> n;
  int ans = 0;
  string s;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    s += c;
    add(ans, solve(s));
    cout << ans << " ";
  }
  cout << "\n";
  return 0;
}
