#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ans, t;
  int len, i, j, check, l, r;
  cin >> len;
  cin >> s;
  check = 0;
  ans = "";
  l = 0;
  r = 0;
  for (i = 0; i < len; i++) {
    if (s[i] > s[i + 1]) {
      l = i + 1;
      for (j = i + 1; j < len; j++) {
        if (s[j] > s[j + 1]) {
          r = j + 1 + 1;
          check = 1;
          break;
        }
      }
      break;
    }
  }
  if (!check)
    printf("NO\n");
  else
    printf("YES\n%d %d\n", l, r);
  return 0;
}
