#include <bits/stdc++.h>
using namespace std;
long long int n, ct1[100005], ct2[100005];
set<pair<long long int, long long int> > mch;
long long int check(long long int st) {
  long long int s = max(ct1[st], ct2[st]);
  long long int sc1 = 0, sc2 = 0;
  if (s == ct1[st])
    sc1 = 1;
  else
    sc2 = 1;
  if (sc1 == 1 && ct1[st] == ct1[st - 1]) return -1;
  if (sc2 == 1 && ct2[st] == ct2[st - 1]) return -1;
  if (st == n) return 1;
  while (1) {
    long long int p1 = lower_bound(ct1 + 1, ct1 + n + 1, s + ct1[st]) - ct1;
    long long int p2 = lower_bound(ct2 + 1, ct2 + n + 1, s + ct2[st]) - ct2;
    if (p1 > n && p2 > n) return -1;
    if (p1 < p2) {
      sc1++;
      st = p1;
      if (p1 == n) {
        if (sc1 > sc2) return max(sc1, sc2);
        return -1;
      }
    } else {
      sc2++;
      st = p2;
      if (p2 == n) {
        if (sc1 < sc2) return max(sc1, sc2);
        return -1;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long int i = 1; i <= n; ++i) {
    ct1[i] = ct1[i - 1];
    ct2[i] = ct2[i - 1];
    long long int a;
    cin >> a;
    if (a == 1)
      ct1[i]++;
    else
      ct2[i]++;
  }
  for (long long int i = 1; i <= n; ++i) {
    if (ct1[i] == ct2[i]) continue;
    long long int s = max(ct1[i], ct2[i]);
    long long int t = check(i);
    if (t == -1) continue;
    mch.insert(make_pair(t, s));
  }
  if (mch.size() == 0) {
    cout << 0;
    return 0;
  }
  cout << mch.size() << '\n';
  for (set<pair<long long int, long long int> >::iterator it = mch.begin();
       it != mch.end(); ++it)
    cout << (*it).first << " " << (*it).second << '\n';
}
