#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
struct Hash {
  const static int md0 = 1e9 + 7, md1 = 1e9 + 9;
  int h0, h1;
  Hash(int h0 = 0, int h1 = 0) : h0(h0), h1(h1) {}
  Hash operator+(const int &o) const {
    return Hash((h0 + o) % md0, (h1 + o) % md1);
  }
  Hash operator*(const int &o) const {
    return Hash(h0 * 1ll * o % md0, h1 * 1ll * o % md1);
  }
  Hash operator+(const Hash &o) const {
    return Hash((h0 + o.h0) % md0, (h1 + o.h1) % md1);
  }
  Hash operator-(const Hash &o) const {
    return Hash((h0 - o.h0 + md0) % md0, (h1 - o.h1 + md1) % md1);
  }
  Hash operator*(const Hash &o) const {
    return Hash(h0 * 1ll * o.h0 % md0, h1 * 1ll * o.h1 % md1);
  }
  bool operator==(const Hash &o) const { return h0 == o.h0 && h1 == o.h1; }
  bool operator!=(const Hash &o) const { return h0 != o.h0 || h1 != o.h1; }
  long long get() { return h0 * 1ll * md1 + h1; }
} pw[maxn], has[maxn][maxn];
const int base = 131;
const int rang = 5000313;
vector<long long> G[rang];
int dp[maxn][maxn];
int a[maxn], vis[maxn], n;
int add(long long h) {
  int u = h % rang;
  for (auto &v : G[u]) {
    if (v == h) return 0;
  }
  G[u].push_back(h);
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  pw[0] = {1, 1};
  for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * base;
  vis[2211] = vis[2121] = vis[1222] = vis[2222] = 1;
  for (int i = 1; i <= n; ++i) dp[i][i - 1] = 1;
  long long ret = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    ++a[i];
    for (int j = 1; j <= i; ++j) {
      has[j][i] = has[j][i - 1] * base + a[i];
      int flg = add(has[j][i].get());
      int cur = 0;
      for (int k = 1; k <= 4; ++k) {
        cur = cur * 10 + a[i - k + 1];
        if (vis[cur] || i - k < j - 1) break;
        dp[j][i] = (dp[j][i] + dp[j][i - k]) % mod;
        if (flg) ret = (ret + dp[j][i - k]) % mod;
      }
    }
    cout << ret << "\n";
  }
  return 0;
}
