#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int locbr1[maxn * 2], locbr2[maxn * 2];
int br1[maxn], br2[maxn];
int arr[maxn];
int n;
vector<pair<int, int> > ans;
int check(int t) {
  int a = 0;
  int b = 0;
  int dismo;
  int poza = locbr1[t];
  int pozb = locbr2[t];
  int zadnji = 0;
  if (poza == -1 or (pozb != -1 and pozb < poza)) {
    dismo = pozb;
    b++;
    zadnji = 2;
  } else {
    dismo = poza;
    a++;
    zadnji = 1;
  }
  while (1) {
    if (dismo == n - 1) break;
    poza = locbr1[t + br1[dismo]];
    pozb = locbr2[t + br2[dismo]];
    if (poza == -1 and pozb == -1)
      return -1;
    else {
      if (poza == -1 or (pozb != -1 and pozb < poza)) {
        dismo = pozb;
        b++;
        zadnji = 2;
      } else {
        dismo = poza;
        a++;
        zadnji = 1;
      }
    }
  }
  if (a == b) return -1;
  int maxi = max(a, b);
  if (maxi == a and zadnji == 2) return -1;
  if (maxi == b and zadnji == 1) return -1;
  return maxi;
}
int main() {
  cin >> n;
  for (int i = 0; i < 2 * maxn; i++) {
    locbr1[i] = -1;
    locbr2[i] = -1;
  }
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (arr[0] == 1) {
    br1[0]++;
    locbr1[1] = 0;
  } else {
    br2[0]++;
    locbr2[1] = 0;
  }
  for (int i = 1; i < n; i++) {
    br1[i] += br1[i - 1];
    br2[i] += br2[i - 1];
    if (arr[i] == 1) {
      br1[i]++;
      locbr1[br1[i]] = i;
    } else {
      br2[i]++;
      locbr2[br2[i]] = i;
    }
  }
  for (int t = 1; t <= n; t++) {
    int a = check(t);
    if (a == -1)
      continue;
    else
      ans.push_back(make_pair(a, t));
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << ' ' << ans[i].second << endl;
  return 0;
}
