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