#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void CI(int &_x) { scanf("%d", &_x); }
void CO(int &_x) { cout << _x; }
template <typename T>
void getarray(T a[], int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename T>
void printarray(T a[], int n) {
  for (int i = 0; i < n - 1; i++) cout << a[i] << " ";
  cout << a[n - 1] << endl;
}
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
int dr8[8] = {1, -1, 0, 0, 1, -1, -1, 1};
int dc8[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dr4[4] = {0, 0, 1, -1};
int dc4[4] = {-1, 1, 0, 0};
int kn8r[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int kn8c[8] = {2, 1, -1, -2, -2, -1, 1, 2};
int n, temp;
vector<int> V;
int prefix_petya[100005], prefix_Gena[100005];
int func(int st, int mid, int type) {
  if (type == 1) {
    return prefix_petya[mid] - prefix_petya[st - 1];
  } else {
    return prefix_Gena[mid] - prefix_Gena[st - 1];
  }
}
int b_search(int st, int val, int type) {
  int low = st, hi = n, ans = 1 << 30;
  while (low <= hi) {
    int mid = (low + hi) / 2;
    int temp = func(st, mid, type);
    if (temp >= val) {
      ans = mid;
      hi = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  return ans;
}
int process(int t) {
  int petya_win = 0, gena_win = 0;
  int st = 1;
  while (1) {
    int x1, x2;
    x1 = b_search(st, t, 1);
    x2 = b_search(st, t, 2);
    int mini = min(x1, x2);
    if (mini >= 1 << 30) return 0;
    if (mini == x1)
      petya_win++;
    else
      gena_win++;
    if (mini == n) {
      if (mini == x1 && petya_win > gena_win) return petya_win;
      if (mini == x2 && petya_win < gena_win) return gena_win;
      return 0;
    }
    st = mini + 1;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> temp;
    if (temp == 1)
      prefix_petya[i] = 1;
    else
      prefix_Gena[i] = 1;
    prefix_Gena[i] += prefix_Gena[i - 1];
    prefix_petya[i] += prefix_petya[i - 1];
  }
  vector<pair<int, int> > result;
  for (int i = 1; i <= n; i++) {
    int temp = process(i);
    if (temp > 0) {
      result.push_back(make_pair(temp, i));
    }
  }
  sort(result.begin(), result.end());
  cout << result.size() << "\n";
  for (int i = 0; i < result.size(); i++)
    cout << result[i].first << " " << result[i].second << "\n";
}
