#include <bits/stdc++.h>
using namespace std;
int n, a[100100], b[100100], k, v;
pair<int, int> c[100100];
int go(int t) {
  int x = 0, y = 0, s1 = 0, s2 = 0;
  while (x < a[n] || y < b[n]) {
    int *px = lower_bound(a, a + n + 1, x + t),
        *py = lower_bound(b, b + n + 1, y + t);
    if (px > a + n && py > b + n) return -1;
    if (px - a < py - b)
      ++s1, py = b + (px - a);
    else
      ++s2, px = a + (py - b);
    if ((px == a + n) && (py == b + n)) {
      if ((s1 > s2 && 1 == v) || (s1 < s2 && 2 == v)) return max(s1, s2);
      break;
    } else
      x = *px, y = *py;
  }
  return -1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n && cin >> v; ++i)
    if (v > 1)
      b[i] = 1;
    else
      a[i] = 1;
  for (int i = 1; i <= n; ++i) a[i] += a[i - 1], b[i] += b[i - 1];
  for (int t = 1; t <= n; ++t) {
    int s = go(t);
    if (s > 0) c[k++] = make_pair(s, t);
  }
  sort(c, c + k);
  cout << k << endl;
  for (int i = 0; i < k; ++i) cout << c[i].first << " " << c[i].second << endl;
}
