#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
struct node {
  int a, b;
} ans[maxn];
int n, s[3][maxn], a[maxn], w[3][maxn], tot;
bool com(node a, node b) {
  if (a.a == b.a) return a.b < b.b;
  return a.a < b.a;
}
int main() {
  scanf("%d", &n);
  memset(w, 0x7f, sizeof(w));
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", &a[i]);
    s[a[i]][i] = s[a[i]][i - 1] + 1;
    s[3 - a[i]][i] = s[3 - a[i]][i - 1];
    w[a[i]][s[a[i]][i]] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int aa = 1, flag = 1, cnt1 = 0, cnt2 = 0, s1 = 0, s2 = 0, now;
    while (aa <= n) {
      if (cnt1 + i > s[1][n] && cnt2 + i > s[2][n]) {
        flag = 0;
        break;
      }
      int x1 = w[1][cnt1 + i], x2 = w[2][cnt2 + i];
      now = min(x1, x2);
      if (x1 < x2)
        s1++;
      else
        s2++;
      cnt1 = s[1][now], cnt2 = s[2][now];
      if (now == n) {
        if (x1 < x2 && s1 < s2 || x1 > x2 && s1 > s2 || s1 == s2) {
          flag = 0;
        }
        break;
      }
      aa = now;
    }
    if (flag) ans[++tot].a = max(s1, s2), ans[tot].b = i;
  }
  sort(ans + 1, ans + 1 + tot, com);
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++) {
    printf("%d %d\n", ans[i].a, ans[i].b);
  }
  return 0;
}
