#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    v.push_back(s[i] - 'a');
  }
  int maxx = v[0], max_index = 0, resindex = -1;
  for (int i = 1; i < n; i++) {
    if (v[i] >= maxx) {
      maxx = v[i];
      max_index = i + 1;
    } else {
      resindex = i + 1;
      break;
    }
  }
  if (resindex == -1)
    cout << "NO";
  else {
    cout << "YES"
         << "\n";
    cout << max_index << " " << resindex;
  }
  return 0;
}
