#include <bits/stdc++.h>
using namespace std;
int arr[100002];
int sum[2][100002];
int main() {
  int n, i, j, k, *ptr, *ptrnew, *ptr2, *ptrnew2, win[2];
  int winner;
  int ans = 0;
  vector<pair<int, int> > listans;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] == 1) {
      if (i == 0) {
        sum[0][i] = 1;
        sum[1][i] = 0;
      } else {
        sum[0][i] = sum[0][i - 1] + 1;
        sum[1][i] = sum[1][i - 1];
      }
    } else {
      if (i == 0) {
        sum[1][i] = 1;
        sum[0][i] = 0;
      } else {
        sum[1][i] = sum[1][i - 1] + 1;
        sum[0][i] = sum[0][i - 1];
      }
    }
  }
  winner = arr[n - 1] - 1;
  if (sum[winner][n - 1] > sum[winner ^ 1][n - 1]) {
    ans = 1;
    listans.push_back(make_pair(sum[winner][n - 1], 1));
  }
  for (i = 2; i <= sum[winner][n - 1]; i++) {
    j = i;
    k = i;
    win[0] = win[1] = 0;
    ptr = sum[winner];
    ptr2 = sum[winner ^ 1];
    for (; ptr != sum[winner] + n;) {
      ptrnew = lower_bound(ptr, sum[winner] + n, j);
      if (ptrnew == sum[winner] + n) goto next;
      if (ptrnew - ptr + 1 < i * 2) {
        win[winner]++;
        ptr = ptrnew + 1;
        ptr2 += (ptr - sum[winner]) - (ptr2 - sum[winner ^ 1]);
        j = *ptrnew + i;
        k = *(ptr2 - 1) + i;
      } else {
        win[winner ^ 1]++;
        ptrnew2 = lower_bound(ptr2, sum[winner ^ 1] + n, k);
        ptr2 = ptrnew2 + 1;
        ptr += (ptr2 - sum[winner ^ 1]) - (ptr - sum[winner]);
        j = *(ptr - 1) + i;
        k = *ptrnew2 + i;
      }
    }
    if (win[winner] > win[winner ^ 1]) {
      ans++;
      listans.push_back(make_pair(win[winner], i));
    }
  next:;
  }
  printf("%d\n", ans);
  sort(listans.begin(), listans.end());
  for (i = 0; i < listans.size(); i++) {
    printf("%d %d\n", listans[i].first, listans[i].second);
  }
  return 0;
}
