#include <bits/stdc++.h>
using namespace std;
int trie[3300 * 3300][2];
int CNODE = 1;
long long dp[3300][3300];
int val[3300];
long long ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> val[i];
  for (int i = 1; i <= n; i++) {
    dp[i][i] = 1;
    int cur = 1;
    for (int j = i - 1; j >= 0; j--) {
      int lst = min(i - j, 4);
      if (lst == 4) {
        int msk = val[j] * 8 + val[j + 1] * 4 + val[j + 2] * 2 + val[j + 3];
        if (msk == 3 || msk == 5 || msk == 14 || msk == 15) lst = 3;
      }
      dp[j][i] = 0;
      for (int k = 1; k <= lst; k++) {
        dp[j][i] += dp[j + k][i];
        if (dp[j][i] >= 1000000007) dp[j][i] -= 1000000007;
      }
      if (trie[cur][val[j]] == 0) {
        ans += dp[j][i];
        if (ans >= 1000000007) ans -= 1000000007;
        trie[cur][val[j]] = ++CNODE;
      }
      cur = trie[cur][val[j]];
    }
    cout << ans << endl;
  }
  return 0;
}
