#include <bits/stdc++.h>
using namespace std;
int n, data[100000], sum[100000];
vector<pair<int, int>> ans;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", data + i);
  for (int i = 0; i < n; i++) {
    sum[i] = data[i] == data[n - 1];
    if (i > 0) sum[i] += sum[i - 1];
  }
  for (int t = 1; t <= sum[n - 1]; t++) {
    int ind = 0;
    int w = 0, l = 0;
    bool valid = false;
    while (ind < n) {
      int s1 = 0, s2 = 0;
      while (s1 < t && s2 < t) {
        if (ind >= n) break;
        int jump = t - max(s1, s2);
        ind += jump;
        if (ind > n) break;
        int earn = sum[ind - 1];
        if (ind - jump > 0) earn -= sum[ind - jump - 1];
        s1 += earn;
        s2 += jump - earn;
      }
      if (s1 < t && s2 < t) break;
      if (s1 == t)
        w++;
      else
        l++;
      if (ind == n) {
        valid = true;
        break;
      }
    }
    if (valid && w > l) ans.push_back(make_pair(w, t));
  }
  printf("%d\n", (int)ans.size());
  sort(ans.begin(), ans.end());
  for (auto a : ans) printf("%d %d\n", a.first, a.second);
  return 0;
}
