#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> v[3];
struct node {
  int s, t;
} q[maxn];
int tot;
bool cmp(node a, node b) {
  if (a.s == b.s) return a.t < b.t;
  return a.s < b.s;
}
int main() {
  int n;
  scanf("%d", &n);
  int ed;
  for (int i = 1; i <= n; i++) {
    int t1;
    scanf("%d", &t1);
    t1 = t1 & 1;
    if (i == n) ed = t1;
    v[t1].push_back(i);
  }
  int es = ed ^ 1;
  int mx = max((int)v[0].size(), (int)v[1].size());
  for (int i = 1; i <= n; i++) {
    int c1 = 0, c2 = 0, s1 = -1, s2 = -1;
    for (int j = i;; j += i) {
      if (i + s1 >= v[ed].size() && i + s2 >= v[es].size()) break;
      if (i + s1 >= v[ed].size()) {
        s2 = s2 + i;
        c2++;
        continue;
      }
      if (i + s2 >= v[es].size()) {
        s1 = s1 + i;
        c1++;
        continue;
      }
      int t1 = v[ed][i + s1], t2 = v[es][i + s2];
      if (t1 > t2) {
        s2 = s2 + i;
        c2++;
        s1 = lower_bound(v[ed].begin(), v[ed].end(), t2) - v[ed].begin() - 1;
      } else {
        s1 = s1 + i;
        c1++;
        s2 = lower_bound(v[es].begin(), v[es].end(), t1) - v[es].begin() - 1;
      }
    }
    if (c1 > c2 && s1 == v[ed].size() - 1) {
      q[++tot].s = c1;
      q[tot].t = i;
    }
  }
  sort(q + 1, q + 1 + tot, cmp);
  cout << tot << endl;
  for (int i = 1; i <= tot; i++) printf("%d %d\n", q[i].s, q[i].t);
}
