#include <bits/stdc++.h>
using namespace std;
int n;
int winner;
int v1[100005];
int v2[100005];
bool operator<(pair<int, int> x, pair<int, int> y) {
  if (x.first < y.first) return true;
  if (x.first > y.first) return false;
  return x.second < y.second;
}
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> winner;
    v1[i + 1] = v1[i];
    v2[i + 1] = v2[i];
    if (winner == 1)
      v1[i + 1]++;
    else
      v2[i + 1]++;
  }
  for (int t = 1; t <= n; t++) {
    int x = 0;
    int w = 0;
    int e = 0;
    bool bad = false;
    while (x < n && !bad) {
      int l = x;
      int r = n - 1;
      while (l < r) {
        int m = (l + r) / 2;
        if (v1[m + 1] - v1[x] < t && v2[m + 1] - v2[x] < t)
          l = m + 1;
        else
          r = m;
      }
      if (v1[l + 1] - v1[x] == t) {
        if (winner == 1)
          w++;
        else
          e++;
      } else if (v2[l + 1] - v2[x] == t) {
        if (winner == 2)
          w++;
        else
          e++;
      } else {
        bad = true;
      }
      x = l + 1;
    }
    if (bad) continue;
    if (e >= w) continue;
    ans.push_back(pair<int, int>(w, t));
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << '\n';
  for (int i = 0; i < (int)ans.size(); i++)
    cout << ans[i].first << ' ' << ans[i].second << '\n';
  return 0;
}
