#include <bits/stdc++.h>
const int N = (int)1e5 + 228;
using namespace std;
int n, a[N], pref1[N], pref2[N];
vector<pair<int, int> > ans;
int calc(int k) {
  int t1 = 0, t2 = 0, pos = 1;
  while (pos <= n) {
    if (pref1[n] - pref1[pos - 1] < k && pref2[n] - pref2[pos - 1] < k)
      return -1;
    int winner = 0;
    int next = n;
    if (pref1[n] - pref1[pos - 1] >= k) {
      int l = pos - 1, r = n + 1, mid;
      while (l < r - 1) {
        mid = (l + r) / 2;
        if (pref1[mid] - pref1[pos - 1] >= k)
          r = mid;
        else
          l = mid;
      }
      winner = 1;
      next = min(next, r);
    }
    if (pref2[n] - pref2[pos - 1] >= k) {
      int l = pos - 1, r = n + 1, mid;
      while (l < r - 1) {
        mid = (l + r) / 2;
        if (pref2[mid] - pref2[pos - 1] >= k)
          r = mid;
        else
          l = mid;
      }
      if (r < next) {
        next = r;
        winner = 2;
      }
    }
    if (winner == 1)
      t1++;
    else
      t2++;
    pos = next + 1;
  }
  if (t1 == t2) return -1;
  if (t2 > t1 && a[n] == 1) return -1;
  if (t2 < t1 && a[n] == 2) return -1;
  return max(t1, t2);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    pref1[i] = pref1[i - 1];
    pref2[i] = pref2[i - 1];
    if (a[i] == 1)
      pref1[i]++;
    else
      pref2[i]++;
  }
  for (int i = 1; i <= n; i++) {
    int res = calc(i);
    if (res != -1) ans.push_back({res, i});
  }
  sort(ans.begin(), ans.end());
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
