#include <bits/stdc++.h>
using namespace std;
const long long int p = (long long int)(1e9 + 7);
int main() {
  int m;
  cin >> m;
  string strans = "";
  vector<string> forbidden{"0011", "0101", "1110", "1111"};
  for (int i = 0; i < m; ++i) {
    char s;
    cin >> s;
    strans += s;
  }
  vector<vector<long long int>> dp(m, vector<long long int>(m, 0));
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i <= j; ++i) {
      long long int ans = (long long int)0;
      for (int k = 0; k <= 3; ++k) {
        if (i > j - k) continue;
        string my_substr = strans.substr(j - k, k + 1);
        int multiplier = 1;
        for (int ind = 0; ind <= 3; ++ind) {
          if (my_substr == forbidden[ind]) multiplier = 0;
        }
        long long int factor = (long long int)1;
        if (i < j - k) {
          factor = dp[i][j - k - 1];
        }
        ans += factor * (long long int)multiplier;
        ans %= p;
      }
      dp[i][j] = ans;
    }
  }
  vector<vector<int>> components(m);
  vector<vector<int>> important_pairs(m);
  for (int i = 0; i < m; ++i) {
    vector<vector<int>> temp_components;
    if (i == 0) {
      vector<int> zeroes;
      vector<int> ones;
      for (int j = 0; j < m; ++j) {
        if (strans[j] == '0')
          zeroes.push_back(j);
        else
          ones.push_back(j);
      }
      sort(zeroes.begin(), zeroes.end());
      sort(ones.begin(), ones.end());
      if (zeroes.size()) temp_components.push_back(zeroes);
      if (ones.size()) temp_components.push_back(ones);
    } else {
      for (int j = 0; j < components.size(); ++j) {
        vector<int> zeroes;
        vector<int> ones;
        for (int k = 0; k < components[j].size(); ++k) {
          int ind = components[j][k];
          if (ind + i >= m) continue;
          if (strans[ind + i] == '0')
            zeroes.push_back(ind);
          else
            ones.push_back(ind);
        }
        sort(zeroes.begin(), zeroes.end());
        sort(ones.begin(), ones.end());
        if (zeroes.size()) temp_components.push_back(zeroes);
        if (ones.size()) temp_components.push_back(ones);
      }
    }
    components = temp_components;
    for (int j = 0; j < components.size(); ++j) {
      vector<int>& this_one = components[j];
      int ind = this_one[0];
      if (ind + i >= m) continue;
      important_pairs[ind + i].push_back(ind);
    }
  }
  long long int final_ans = (long long int)0;
  for (int i = 0; i < m; ++i) {
    vector<int>& this_pair = important_pairs[i];
    for (int j = 0; j < this_pair.size(); ++j) {
      final_ans += dp[this_pair[j]][i];
      final_ans %= p;
    }
    cout << final_ans << endl;
  }
  return 0;
}
