#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int suma[100005];
int sumb[100005];
int w[100005];
int n;
vector<pair<int, int> > v;
void process() {
  int i;
  int x = 0, y = 0;
  for (i = 1; i <= n; i++) {
    suma[i] = suma[i - 1];
    sumb[i] = sumb[i - 1];
    if (w[i] == 1) {
      x++;
      a[x] = i;
      suma[i]++;
    } else {
      y++;
      b[y] = i;
      sumb[i]++;
    }
  }
}
int verify(int x) {
  int cnt1 = 0, cnt2 = 0;
  int p = 0, q = 0;
  int lst = 0;
  while (true) {
    int np, nq, cp = 1e9, cq = 1e9;
    np = p + x;
    nq = q + x;
    if (np <= n && a[np] != 0) {
      cp = a[np];
    }
    if (nq <= n && b[nq] != 0) {
      cq = b[nq];
    }
    int mn = min(cp, cq);
    if (mn == 1e9) {
      return -1;
    } else {
      if (cp < cq) {
        lst = 1;
        cnt1++;
        p += (x);
        q = (sumb[cp]);
      } else {
        lst = 2;
        cnt2++;
        q += x;
        p = suma[cq];
      }
    }
    if (mn == n) {
      break;
    }
  }
  if (cnt1 == cnt2 || (lst == 1 && cnt1 < cnt2) || (lst == 2 && cnt1 > cnt2)) {
    return -1;
  } else {
    return max(cnt1, cnt2);
  }
}
int main() {
  scanf("%d", &n);
  int i, j;
  for (i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
  }
  process();
  for (i = 1; i <= n; i++) {
    int x = verify(i);
    if (x != -1) {
      v.push_back(make_pair(x, i));
    }
  }
  printf("%d\n", v.size());
  sort(v.begin(), v.end());
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); it++) {
    printf("%d %d\n", (*it).first, (*it).second);
  }
  return 0;
}
