#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char x[n];
  scanf("%s", x);
  char dup[n];
  for (int i = 0; i < n; i++) dup[i] = x[i];
  sort(dup, dup + n);
  if (dup == x)
    cout << "NO";
  else {
    cout << "YES" << endl;
    int pos, pos1;
    int temp = INT_MAX;
    for (int i = 0; i < n; i++) {
      if (x[i] <= temp) {
        temp = x[i];
        pos = i + 1;
      }
    }
    temp = INT_MIN;
    for (int i = n - 1; i >= 0; i--) {
      if (x[i] >= temp) {
        temp = x[i];
        pos1 = i + 1;
      }
    }
    cout << pos1 << " " << pos;
  }
  return 0;
}
