#include <bits/stdc++.h>
using namespace std;
void printVector(const vector<int> &nums) {
  int size = nums.size();
  for (int i = 0; i < size; i++) cout << nums[i] << " ";
  cout << endl;
}
pair<int, int> getResult(vector<int> &p1, vector<int> &p2, int t) {
  vector<int>::iterator it1 = p1.begin();
  vector<int>::iterator it2 = p2.begin();
  int s1 = 0, s2 = 0, last = 0;
  while (it1 != p1.end() || it2 != p2.end()) {
    if (it1 + t <= p1.end()) {
      if (it2 == p2.end()) {
        s1++;
        last = 1;
        it1 += t;
      } else if (*(it1 + t - 1) < *(min(it2 + t, p2.end()) - 1)) {
        it1 += t;
        s1++;
        last = 1;
        it2 = upper_bound(it2, min(it2 + t, p2.end()), *(it1 - 1));
      } else if (p2.end() - it2 >= t) {
        it2 += t;
        s2++;
        last = 2;
        it1 = upper_bound(it1, min(it1 + t, p1.end()), *(it2 - 1));
      } else {
        s1++;
        last = 1;
        it2 = p2.end();
        it1 += t;
      }
    } else if (it2 + t <= p2.end()) {
      if (it1 == p1.end()) {
        it2 += t;
        s2++;
        last = 2;
      } else if (*(it2 + t - 1) < *(min(it1 + t, p1.end()) - 1)) {
        it2 += t;
        s2++;
        last = 2;
        it1 = upper_bound(it1, min(it1 + t, p1.end()), *(it2 - 1));
      } else {
        s2++;
        last = 2;
        it1 = p1.end();
        it2 += t;
      }
    } else {
      return (pair<int, int>(false, 0));
    }
  }
  if (s1 == s2 || (s1 > s2 && last == 2) || (s2 > s1 && last == 1))
    return pair<int, int>(false, 0);
  return pair<int, int>(true, max(s1, s2));
}
void solve(vector<int> &p1, vector<int> &p2) {
  set<pair<int, int> > result;
  pair<int, int> check;
  int size = 0;
  int maxsize = max(p1.size(), p2.size());
  int t = 1;
  while (t <= maxsize) {
    check = getResult(p1, p2, t);
    if (check.first) {
      result.insert(pair<int, int>(check.second, t));
      size++;
    }
    t++;
  }
  cout << size << endl;
  for (typeof((result).begin()) it = (result).begin(); it != (result).end();
       it++) {
    printf("%d %d\n", (*it).first, (*it).second);
  }
}
int main() {
  vector<int> p1, p2;
  int n, tmp, k;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    if (tmp == 1)
      p1.push_back(i);
    else
      p2.push_back(i);
  }
  set<pair<int, int> > result;
  solve(p1, p2);
  return 0;
}
