#include <bits/stdc++.h>
using namespace std;
struct Counter {
  static int k;
  Counter() { k++; }
  ~Counter() { k--; }
};
int Counter::k = 0;
template <typename T>
void pr(const string& name, T t) {
  cout << name << " = " << t << endl;
}
template <typename T, typename... Types>
void pr(const string& names, T t, Types... rest) {
  auto comma_pos = names.find(',');
  cout << names.substr(0, comma_pos) << " = " << t << ", ";
  auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
  pr(string(names, next_name_pos), rest...);
}
void mod(long long& a, long long b) {
  a %= b;
  if (a < 0) a += b;
}
const long long MOD = 1000000007;
const int INF = 999999;
int A[100005], S[100005][3];
int N;
vector<pair<int, int>> V;
int main() {
  cin >> N;
  for (int i = (1); i <= (N); i++) cin >> A[i];
  for (int i = (1); i <= (N); i++) {
    S[i][1] = S[i - 1][1] + (A[i] == 1);
    S[i][2] = S[i - 1][2] + (A[i] == 2);
  }
  for (int t = (1); t <= (N); t++) {
    int last_winner, sc[3];
    sc[1] = sc[2] = 0;
    bool good = true;
    int start = 0;
    while (start <= N) {
      int win[3];
      for (int player = (1); player <= (2); player++) {
        int a = start, b = N;
        while (b - a > 1) {
          int p = (a + b) / 2;
          if (S[p][player] - S[start - 1][player] >= t)
            b = p;
          else
            a = p;
        }
        if (S[a][player] - S[start - 1][player] >= t)
          win[player] = a;
        else if (S[b][player] - S[start - 1][player] >= t)
          win[player] = b;
        else
          win[player] = INF;
      }
      if (win[1] == INF && win[2] == INF) {
        good = false;
        break;
      }
      if (win[1] < win[2])
        sc[1]++, last_winner = 1;
      else
        sc[2]++, last_winner = 2;
      start = min(win[1], win[2]) + 1;
    }
    if (start <= N) good = false;
    if (sc[1] == sc[2]) good = false;
    if (sc[1] < sc[2] && last_winner == 1) good = false;
    if (sc[2] < sc[1] && last_winner == 2) good = false;
    if (good) V.push_back(make_pair(max(sc[1], sc[2]), t));
  }
  sort(V.begin(), V.end());
  cout << ((int)V.size()) << "\n";
  for (pair<int, int> p : V) cout << p.first << " " << p.second << "\n";
}
