#include <bits/stdc++.h>
using namespace std;
int sum1[100005], sum2[100005];
int a[100005];
vector<pair<int, int> > st;
int N;
int bsearch(int *s, int val, int margin) {
  int lo = 0, hi = N - 1, mid;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (s[mid] - margin < val)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  return lo;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    a[i]--;
    sum1[i] = a[i];
    if (i > 0) sum1[i] += sum1[i - 1];
    sum2[i] = i + 1 - sum1[i];
  }
  for (int k = 1; k <= N; k++) {
    bool ok = true;
    int score[2] = {0, 0};
    int acc[2] = {0, 0};
    int last_win = -1;
    while (true) {
      int pos = bsearch(sum1, k, acc[0]);
      if (pos >= N || sum1[pos] - acc[0] != k ||
          sum1[pos] - acc[0] <= sum2[pos] - acc[1]) {
        pos = bsearch(sum2, k, acc[1]);
        if (pos >= N || sum2[pos] - acc[1] != k) {
          ok = false;
          break;
        } else {
          score[1]++;
          last_win = 1;
        }
      } else {
        score[0]++;
        last_win = 0;
      }
      acc[0] = sum1[pos];
      acc[1] = sum2[pos];
      if (pos == N - 1) break;
    }
    if (!ok || (score[0] == score[1])) continue;
    if (score[0] > score[1] && last_win == 0 ||
        score[1] > score[0] && last_win == 1)
      st.push_back(make_pair(max(score[0], score[1]), k));
  }
  sort(st.begin(), st.end());
  printf("%d\n", st.size());
  for (int i = 0; i < st.size(); i++) {
    printf("%d %d\n", st[i].first, st[i].second);
  }
  return 0;
}
