#include <bits/stdc++.h>
using namespace std;
int main() {
  string alf = "abcdefghijklmnopqrstuvwyz";
  string s;
  long k, n, p;
  cin >> p;
  cin >> s;
  for (int i = 1; i <= s.length() - 2; i++) {
    if (alf.find(s[i]) > alf.find(s[i + 1])) {
      k++;
    } else {
      n = i;
      break;
    }
  }
  if (k != s.length() - 3) {
    cout << "YES" << endl << n << ' ' << n + 1;
  } else {
    cout << "NO";
  }
}
