#include <bits/stdc++.h>
using namespace std;
const int maxn = 100003;
int winPetya[maxn];
int winGena[maxn];
int n;
const int oo = 2000000000;
int binarySearch(int t, int *array, int st) {
  int end = n - 1;
  int valA = st ? array[st - 1] : 0;
  int x = oo;
  while (st <= end) {
    int mid = (st + end) / 2;
    if (array[mid] - valA == t) {
      x = mid;
    }
    if (array[mid] - valA < t) {
      st = mid + 1;
    } else {
      end = mid - 1;
    }
  }
  return x;
}
int petyaS, genaS, lastWinner;
bool calculateS(int t, int a = 0) {
  if (a == n) {
    return (lastWinner == 1 && petyaS > genaS) ||
           (lastWinner == 2 && genaS > petyaS);
  }
  int bPetya = binarySearch(t, winPetya, a);
  int bGena = binarySearch(t, winGena, a);
  if (bPetya == oo && bGena == oo) {
    return false;
  }
  if (bPetya < bGena) {
    petyaS++;
    lastWinner = 1;
    return calculateS(t, bPetya + 1);
  } else {
    genaS++;
    lastWinner = 2;
    return calculateS(t, bGena + 1);
  }
}
int main() {
  vector<pair<int, int> > v;
  int a;
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %d", &a);
    winPetya[i] = (i ? winPetya[i - 1] : 0) + (a == 1);
    winGena[i] = (i ? winGena[i - 1] : 0) + (a == 2);
  }
  for (int t = 1; t <= n; t++) {
    petyaS = genaS = lastWinner = 0;
    if (calculateS(t)) {
      int s = max(petyaS, genaS);
      v.push_back(make_pair(s, t));
    }
  }
  sort(v.begin(), v.end());
  printf("%d\n", v.size());
  for (int i = 0; i < v.size(); i++) {
    printf("%d %d\n", v[i].first, v[i].second);
  }
  return 0;
}
