#include <bits/stdc++.h>
using namespace std;
int abs(int x) {
  if (x < 0) return -x;
  return x;
}
int addmod(int v1, int v2) {
  int v3 = v1 + v2;
  if (v3 >= 1000000007) v3 -= 1000000007;
  return v3;
}
int cc[100];
int a[200005], pos1[200005], pos2[200005];
int a1[200005], a2[200005];
int main() {
  int n;
  scanf("%d", &n);
  int v1, v2;
  v1 = v2 = 0;
  for (int i = (1); i < (2 * n + 5); i++) {
    pos1[i] = pos2[i] = n;
  }
  for (int i = (0); i < (n); i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1)
      pos1[++v1] = i;
    else
      pos2[++v2] = i;
    if (a[i] == 1)
      a1[i]++;
    else
      a2[i]++;
    if (i) a1[i] += a1[i - 1];
    if (i) a2[i] += a2[i - 1];
  }
  vector<pair<int, int> > ans;
  for (int i = (1); i < (n + 1); i++) {
    int pos = 0;
    int c1, c2;
    c1 = c2 = 0;
    int p1, p2;
    p1 = p2 = 0;
    while (1) {
      if (pos1[p1 + i] < pos2[p2 + i]) {
        pos = pos1[p1 + i];
        if (pos >= n) break;
        p1 = a1[pos];
        p2 = a2[pos];
        c1++;
      } else if (pos1[p1 + i] > pos2[p2 + i]) {
        pos = pos2[p2 + i];
        if (pos >= n) break;
        p1 = a1[pos];
        p2 = a2[pos];
        c2++;
      } else
        break;
    }
    if (pos == n - 1) {
      if (a[n - 1] == 1 && c1 > c2) ans.push_back(pair<int, int>(c1, i));
      if (a[n - 1] == 2 && c2 > c1) ans.push_back(pair<int, int>(c2, i));
    }
  }
  sort(ans.begin(), ans.end());
  cout << (ans.size()), cout << (endl);
  for (int i = (0); i < (ans.size()); i++) {
    cout << (ans[i].first), cout << (" "), cout << (ans[i].second),
        cout << (endl);
  }
  return 0;
}
