#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
vector<pair<int, int> > r;
int v[N], pref1[N], pref2[N];
int n;
int calcula(int t) {
  int i = 0;
  int r = 0, p1 = 0, p2 = 0;
  while (i <= n) {
    int prox = lower_bound(pref1 + i, pref1 + n + 1, pref1[i] + t) - pref1;
    int prox2 = lower_bound(pref2 + i, pref2 + n + 1, pref2[i] + t) - pref2;
    i = min(prox, prox2);
    if (prox < prox2) p1++;
    if (prox2 < prox) p2++;
    r++;
    if (i == n and prox < prox2 and p1 > p2) return p1;
    if (i == n and prox > prox2 and p1 < p2) return p2;
  }
  return -1;
}
int main() {
  scanf("%d", &n);
  int p1 = 0, p2 = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]);
  for (int i = 1; i <= n; i++) {
    pref1[i] = pref1[i - 1];
    pref2[i] = pref2[i - 1];
    if (v[i] == 1)
      pref1[i]++;
    else
      pref2[i]++;
  }
  pref1[n + 1] = pref2[n + 1] = INF;
  for (int t = 1; t <= n; t++) {
    int s = calcula(t);
    if (s != -1) r.push_back(make_pair(s, t));
  }
  sort(r.begin(), r.end());
  cout << r.size() << "\n";
  for (int i = 0; i < r.size(); i++)
    cout << r[i].first << " " << r[i].second << "\n";
  return 0;
}
