#include <bits/stdc++.h>
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
using namespace std;
const long long maxn = 1e5 + 7;
const double eps = 1e-10;
const long long mod = 1e9 + 7;
long long n;
long long totA = 0, totB = 0;
long long casA[maxn * 2], casB[maxn * 2];
long long tot = 0;
struct Node {
  long long set, score;
};
Node node[maxn];
bool cmp(Node a, Node b) {
  if (a.set < b.set) return 1;
  if (a.set == b.set && a.score < b.score) return 1;
  return 0;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i < 2 * maxn; i++)
    casA[i] = casB[i] = 9223372036854775807;
  bool flagA = 0, flagB = 0;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x == 1)
      casA[++totA] = i;
    else
      casB[++totB] = i;
    if (i == n) {
      if (x == 1)
        flagA = 1;
      else
        flagB = 1;
    }
  }
  for (long long i = n; i >= 1; i--) {
    long long winA = 0, winB = 0, tarA = 0, tarB = 0;
    long long now = 1;
    bool flag = 1;
    while (now <= n) {
      if (casA[tarA + i] == 9223372036854775807 &&
          casB[tarB + i] == 9223372036854775807) {
        flag = 0;
        break;
      }
      if (casA[tarA + i] < casB[tarB + i]) {
        winA++;
        tarA += i;
        tarB = casA[tarA] - tarA;
        now = casA[tarA] + 1;
      } else {
        winB++;
        tarB += i;
        tarA = casB[tarB] - tarB;
        now = casB[tarB] + 1;
      }
    }
    if (winA == winB) flag = 0;
    if (winA > winB && flagB) flag = 0;
    if (winA < winB && flagA) flag = 0;
    if (flag) {
      node[++tot].set = max(winA, winB);
      node[tot].score = i;
    }
  }
  sort(node, node + tot, cmp);
  cout << tot << "\n";
  if (tot) {
    for (long long i = 1; i <= tot; i++)
      cout << node[i].set << ' ' << node[i].score << "\n";
  }
}
