#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<int> > winning(2, vector<int>(n + 1, 0));
  int ai;
  int winner;
  for (int i = 0; i < n; ++i) {
    cin >> ai;
    for (int j = 0; j < 2; ++j) {
      winning[j][i + 1] = winning[j][i];
    }
    winning[ai - 1][i + 1] += 1;
    if (i == n - 1) {
      winner = ai - 1;
    }
  }
  vector<pair<int, int> > ans;
  for (int i = 1; i <= winning[winner][n]; ++i) {
    int sets[2] = {
        0,
    };
    int beginning[2] = {
        0,
    };
    int ending[2] = {
        0,
    };
    while (true) {
      for (int j = 0; j < 2; ++j) {
        auto it = lower_bound(winning[j].begin() + beginning[j],
                              winning[j].end(), winning[j][beginning[j]] + i);
        ending[j] = it - winning[j].begin();
      }
      int p;
      if (ending[0] < ending[1]) {
        sets[0] += 1;
        p = ending[0];
      } else {
        sets[1] += 1;
        p = ending[1];
      }
      if (p == n + 1) {
        break;
      } else if (p == n) {
        if (sets[winner] > sets[winner ^ 1]) {
          ans.push_back({sets[winner], i});
          break;
        }
      }
      beginning[0] = beginning[1] = p;
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << '\n';
  for (auto e : ans) {
    cout << e.first << " " << e.second << '\n';
  }
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
