#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
long long pre_a[100005];
long long pre_b[100005];
struct dt {
  long long a, b;
};
bool comp(dt a, dt b) {
  if (a.a != b.a)
    return a.a < b.a;
  else
    return a.b < b.b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> arr[i];
    pre_a[i] = pre_a[i - 1] + (arr[i] == 1);
    pre_b[i] = pre_b[i - 1] + (arr[i] == 2);
  }
  vector<dt> v;
  for (long long t = 1; t <= n; t++) {
    long long pos = 0, ta = t, tb = t, f = 0, s_a = 0, s_b = 0, last_pos = 0;
    while (pos < n) {
      long long na = lower_bound(pre_a, pre_a + n + 1, ta) - pre_a;
      long long nb = lower_bound(pre_b, pre_b + n + 1, tb) - pre_b;
      if (na < nb)
        s_a++;
      else
        s_b++;
      pos = min(na, nb);
      ta = pre_a[pos] + t;
      tb = pre_b[pos] + t;
      if (pos == n) {
        if (na < nb && s_a > s_b) f = 1;
        if (nb < na && s_b > s_a) f = 1;
      }
    }
    if (f) v.push_back({max(s_a, s_b), t});
  }
  sort(v.begin(), v.end(), comp);
  cout << v.size() << "\n";
  for (auto i : v) cout << i.a << " " << i.b << "\n";
}
