#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
inline long long power(long long a, long long b) {
  long long multiply = 1;
  for (int i = (0); i < (b); i++) {
    multiply *= a;
  }
  return multiply;
}
int n, a[100005];
int sum[3][100005];
int find(int t) {
  int temp1 = 0, temp2 = 0;
  int prev = 0, setOne = 0, setTwo = 0, last = 0;
  while (true) {
    int one = lower_bound(sum[1] + prev, sum[1] + n + 1, temp1 + t) - sum[1];
    int two = lower_bound(sum[2] + prev, sum[2] + n + 1, temp2 + t) - sum[2];
    if (one > n && two > n) break;
    if (one < two) {
      setOne++;
      prev = one;
      last = one;
      temp1 = sum[1][one];
      temp2 = sum[2][one];
    } else {
      setTwo++;
      prev = two;
      last = two;
      temp1 = sum[1][two];
      temp2 = sum[2][two];
    }
  }
  if (last != n || setOne == setTwo) return 0;
  if (a[last] == 1 && setTwo > setOne) return 0;
  if (a[last] == 2 && setOne > setTwo) return 0;
  return max(setOne, setTwo);
}
pair<int, int> ans[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = (1); i < (n + 1); i++) {
    cin >> a[i];
    sum[a[i]][i]++;
    sum[1][i] += sum[1][i - 1];
    sum[2][i] += sum[2][i - 1];
  }
  int j = 0;
  for (int i = (1); i < (n + 1); i++) {
    int x = find(i);
    if (x) ans[j++] = make_pair(x, i);
  }
  sort(ans, ans + j);
  cout << j << endl;
  for (int i = 0; i < j; i++)
    cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}
