#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int a[MAXN], b[MAXN];
pair<int, int> ans[MAXN];
int main() {
  int n, x;
  scanf("%d", &n);
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    switch (x) {
      case 1:
        ++a[i];
        break;
      case 2:
        ++b[i];
        break;
    }
    a[i] += a[i - 1];
    b[i] += b[i - 1];
  }
  int k = 0, tmax = max(a[n], b[n]);
  for (int t = 1; t <= tmax; ++t) {
    int sa = 0, sb = 0, p = 0;
    bool flag = true;
    while (true) {
      int pa = lower_bound(a + p + 1, a + n + 1, a[p] + t) - a,
          pb = lower_bound(b + p + 1, b + n + 1, b[p] + t) - b;
      if (pa < pb) {
        ++sa;
        p = pa;
      } else {
        ++sb;
        p = pb;
      }
      if (p == n + 1) flag = false;
      if (p >= n) {
        if (sa == sb || (p == pa && sa < sb) || (p == pb && sa > sb))
          flag = false;
        break;
      }
    }
    if (flag) ans[k++] = make_pair(max(sa, sb), t);
  }
  sort(ans, ans + k);
  printf("%d\n", k);
  for (int i = 0; i < k; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
}
