#include <bits/stdc++.h>
using namespace std;
inline int max3(int a, int b, int c) { return max(a, max(b, c)); }
const int maxn = 100001;
const int INF = 0x3F3F3F3F3F;
const double EPS = 1e-8;
const double PI = 3.14159;
const pair<int, int> INFp = make_pair(0x3F3F3F3F, 0x3F3F3F3F);
int n;
int a[maxn], c1[maxn], c2[maxn];
vector<int> l1, l2;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      l1.push_back(i);
      c1[i + 1] = c1[i] + 1;
      c2[i + 1] = c2[i];
    } else {
      l2.push_back(i);
      c1[i + 1] = c1[i];
      c2[i + 1] = c2[i] + 1;
    }
  }
  vector<pair<int, int> > ans;
  for (int t = 1; t <= n; t++) {
    int s1 = 0, s2 = 0;
    bool flag = true;
    for (int i = 0; i < n && flag;) {
      int p1 = (c1[i] + t - 1 < l1.size()) ? l1[c1[i] + t - 1] : n + 1;
      int p2 = (c2[i] + t - 1 < l2.size()) ? l2[c2[i] + t - 1] : n + 1;
      if (p1 < p2) {
        s1++;
        i = p1 + 1;
      } else if (p2 < p1) {
        s2++;
        i = p2 + 1;
      } else {
        flag = false;
      }
    }
    if (flag) {
      if (s1 > s2 && a[n - 1] == 1) {
        ans.push_back(make_pair(s1, t));
      }
      if (s2 > s1 && a[n - 1] == 2) {
        ans.push_back(make_pair(s2, t));
      }
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
  return 0;
}
