#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)1e18 + 7;
const int MAX = (int)1e5 + 50;
const int mod = (int)1e9 + 9;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int n;
  while (cin >> n) {
    vector<int> f(n), s(n);
    int cnt1 = 0, cnt2 = 0, mx = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      if (x == 1) cnt1++;
      if (x == 2) cnt2++;
      f[i] = cnt1;
      s[i] = cnt2;
      mx = max(cnt1, cnt2);
    }
    vector<pair<int, int> > res;
    for (int i = 1; i <= mx; i++) {
      cnt1 = cnt2 = i;
      int f1 = 1, f2 = 1;
      int sc1 = 0, sc2 = 0, idx1 = -1, idx2 = -1;
      while (f1 || f2) {
        f1 = 0, f2 = 0;
        if (binary_search(f.begin(), f.end(), cnt1)) {
          f1 = 1;
          idx1 = lower_bound(f.begin(), f.end(), cnt1) - f.begin();
        }
        if (binary_search(s.begin(), s.end(), cnt2)) {
          f2 = 1;
          idx2 = lower_bound(s.begin(), s.end(), cnt2) - s.begin();
        }
        if (f1 && !f2) {
          cnt1 += i;
          cnt2 = s[idx1] + i;
          sc1++;
          if (idx1 == n - 1) {
            if (sc1 > sc2) {
              res.push_back(make_pair(sc1, i));
            }
            break;
          }
        }
        if (f2 && !f1) {
          cnt2 += i;
          cnt1 = f[idx2] + i;
          sc2++;
          if (idx2 == n - 1) {
            if (sc2 > sc1) {
              res.push_back(make_pair(sc2, i));
            }
            break;
          }
        }
        if (f1 && f2) {
          if (idx1 < idx2) {
            cnt2 = s[idx1] + i;
            cnt1 += i;
            sc1++;
          } else {
            cnt1 = f[idx2] + i;
            cnt2 += i;
            sc2++;
          }
        }
      }
    }
    sort(res.begin(), res.end());
    cout << (int)(res.size()) << "\n";
    for (int i = 0; i < (int)(res.size()); i++)
      cout << res[i].first << " " << res[i].second << "\n";
  }
  return 0;
}
