#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  string s;
  cin >> x;
  cin >> s;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] - 'a' < s[i - 1] - 'a') {
      cout << "YES" << endl;
      cout << i - 1 << ' ' << i;
      return 0;
    }
  }
  cout << "NO";
}
