#include <bits/stdc++.h>
using namespace std;
int tmp, n, cnt, sum1[100010], sum2[100010];
pair<int, int> ans[100010];
int Judge(int t) {
  int s1 = 0, s2 = 0, c1 = 0, c2 = 0, last;
  while (1) {
    int p1 = lower_bound(sum1, sum1 + n + 1, c1 + t) - sum1;
    int p2 = lower_bound(sum2, sum2 + n + 1, c2 + t) - sum2;
    if (p1 > n && p2 > n) break;
    if (p2 < p1) {
      swap(p1, p2);
      s2++, last = 2;
    } else
      s1++, last = 1;
    c1 = sum1[p1];
    c2 = sum2[p1];
  }
  if (c1 + c2 < n || s1 == s2 || (s1 < s2 && last == 1) ||
      (s1 > s2 && last == 2))
    return 0;
  return max(s1, s2);
}
int main() {
  int v;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v);
    sum1[i] = sum1[i - 1];
    sum2[i] = sum2[i - 1];
    if (v == 1)
      sum1[i]++;
    else
      sum2[i]++;
  }
  for (int t = 1; t <= n; ++t)
    if (tmp = Judge(t)) ans[++cnt] = make_pair(tmp, t);
  sort(ans + 1, ans + cnt + 1);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
