#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 1e5 + 1;
int a[N] = {};
int cum1[N] = {};
int cum2[N] = {};
int globvar;
bool check(int t) {
  int upto = 0;
  int w1 = 0, w2 = 0;
  while (upto < n) {
    int l = upto + 1;
    int r = n;
    while (l < r) {
      int mid = (l + r) / 2;
      if (cum1[mid] - cum1[upto] >= t || cum2[mid] - cum2[upto] >= t) {
        r = mid;
      } else
        l = mid + 1;
    }
    if (cum1[l] - cum1[upto] >= t)
      w1++;
    else if (cum2[l] - cum2[upto] >= t)
      w2++;
    else
      return false;
    upto = l;
  }
  globvar = max(w1, w2);
  if (w1 != w2) {
    if (w1 > w2 && a[n] == 1)
      return true;
    else if (w2 > w1 && a[n] == 2)
      return true;
    else
      return false;
  } else
    return false;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i <= n; i++) {
    if (a[i] == 1) cnt1++;
    if (a[i] == 2) cnt2++;
    cum1[i] = cnt1;
    cum2[i] = cnt2;
  }
  int ans[N] = {};
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (check(i)) {
      ans[i] = globvar;
      cnt++;
    }
  }
  cout << cnt << endl;
  vector<pair<int, int>> v;
  for (int i = 1; i <= n; i++) {
    if (ans[i]) v.push_back(make_pair(ans[i], i));
  }
  sort(v.begin(), v.end());
  for (auto e : v) cout << e.first << ' ' << e.second << endl;
  return 0;
}
