#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  string s;
  cin >> s;
  int flag = 0, ind = 1, lastind;
  for (int i = 1; i < n - 1; ++i) {
    if (s[i] > s[i + 1]) {
      if (flag == 0) {
        ind = i;
        flag = 1;
      } else {
        lastind = i;
      }
    }
  }
  if (flag == 1) {
    cout << "YES" << endl;
    cout << ind + 1 << " " << n << endl;
  } else
    cout << "NO" << endl;
}
