#include <bits/stdc++.h>
using namespace std;
int d[3][100000 + 5], g[100000 + 5], n;
int tell(int t) {
  int l = 0, sl = 0, w = 0, sw = 0;
  int p = 0, f = 1;
  while (f and p != n) {
    p = upper_bound(d[1] + 1, d[1] + n + 1, l + t - 1) - d[1];
    if (d[1][p] == l + t and d[2][p] < w + t) {
      l = d[1][p];
      w = d[2][p];
      ++sl;
      continue;
    }
    p = upper_bound(d[2] + 1, d[2] + n + 1, w + t - 1) - d[2];
    if (d[2][p] == w + t and d[1][p] < l + t) {
      l = d[1][p];
      w = d[2][p];
      ++sw;
      continue;
    }
    if (p != n) f = 0;
  }
  if (f) {
    if (sl < sw) return sw;
  }
  return -1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; + i++) cin >> g[i];
  int w = g[n];
  for (int i = 1; i <= n; ++i) {
    if (w == g[i]) {
      d[2][i] = d[2][i - 1] + 1;
      d[1][i] = d[1][i - 1];
    } else {
      d[2][i] = d[2][i - 1];
      d[1][i] = d[1][i - 1] + 1;
    }
  }
  vector<pair<int, int> > v;
  for (int t = 1; t <= n; ++t) {
    int s = tell(t);
    if (s >= 1) {
      v.push_back(make_pair(s, t));
    }
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i].first << ' ' << v[i].second << endl;
  }
}
