#include <bits/stdc++.h>
using namespace std;
int main() {
  int cw = 0, i, n, winfreq1[100010], winfreq2[100010], c1 = 0, c2 = 0,
      pos1[100010], pos2[100010], r, s, t1, t2, num1, num2;
  int p1, p2;
  vector<pair<int, int> > op;
  bool f, f1, f2;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &r);
    if (r == 1) {
      ++c1;
      pos1[c1] = i;
    } else {
      ++c2;
      pos2[c2] = i;
    }
    winfreq1[i] = c1;
    winfreq2[i] = c2;
  }
  for (s = 1; s <= n; ++s) {
    t1 = t2 = 0;
    num1 = num2 = 0;
    f1 = f2 = 0;
    while ((num1 + s) <= c1 || (num2 + s) <= c2) {
      if ((num1 + s) > c1) {
        ++t2;
        num1 = winfreq1[pos2[num2 + s]];
        num2 = num2 + s;
        f2 = 1;
        f1 = 0;
      } else if ((num2 + s) > c2) {
        ++t1;
        f1 = 1;
        f2 = 0;
        num2 = winfreq2[pos1[num1 + s]];
        num1 = num1 + s;
      } else {
        if (pos1[num1 + s] < pos2[num2 + s]) {
          f1 = 1;
          f2 = 0;
          num2 = winfreq2[pos1[num1 + s]];
          ++t1;
          num1 = num1 + s;
        } else {
          num1 = winfreq1[pos2[num2 + s]];
          f2 = 1;
          f1 = 0;
          ++t2;
          num2 = num2 + s;
        }
      }
    }
    if ((num1 == c1 && num2 == c2) && (f2 && t2 > t1 || f1 && t1 > t2)) {
      ++cw;
      op.push_back(make_pair(max(t1, t2), s));
    }
  }
  sort(op.begin(), op.begin() + cw);
  printf("%d\n", cw);
  for (i = 0; i < cw; ++i) printf("%d %d\n", op[i].first, op[i].second);
}
