#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str, l, r;
  cin >> str;
  for (int i = 0; i < (n - 1); i++) {
    l.push_back(str[i]);
    for (int j = i + 1; j < n; j++) {
      r.push_back(str[j]);
      if (l.compare(r) > 0) {
        cout << "YES" << endl;
        cout << i << " " << n - 1 - i;
        return 0;
      }
      r.clear();
    }
    l.clear();
  }
  cout << "NO";
  return 0;
}
