#include <bits/stdc++.h>
using namespace std;
int n, winner;
int sum[2][100042];
vector<pair<int, int>> sts;
inline int get(int t) {
  int pos = 0;
  int score[2]{0, 0};
  while (pos < n) {
    int p0 =
        lower_bound(sum[0] + pos, sum[0] + n + 1, sum[0][pos] + t) - sum[0];
    int p1 =
        lower_bound(sum[1] + pos, sum[1] + n + 1, sum[1][pos] + t) - sum[1];
    if (p0 < p1) {
      ++score[0];
      pos = p0;
    } else {
      ++score[1];
      pos = p1;
    }
  }
  return pos > n || score[winner] <= score[winner ^ 1] ? -1 : score[winner];
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> winner;
    sum[0][i + 1] = sum[0][i];
    sum[1][i + 1] = sum[1][i];
    ++sum[--winner][i + 1];
  }
  for (int lt = 0, i = n - 1; i >= 0; --i) {
    int t = sum[winner][n] - sum[winner][i];
    if (lt == t) continue;
    lt = t;
    if (t <= sum[winner ^ 1][n] - sum[winner ^ 1][i]) continue;
    int s = get(t);
    if (s < 0) continue;
    sts.push_back({s, t});
  }
  sort(sts.begin(), sts.end());
  cout << sts.size() << '\n';
  for (auto &p : sts) cout << p.first << ' ' << p.second << '\n';
}
