#include <bits/stdc++.h>
char str[300000];
int main() {
  long len;
  scanf("%ld", &len);
  scanf("%s", str);
  long i, j, first, last, flag = 0;
  for (i = 0; i < len; i++) {
    if (str[i] < str[i + 1]) {
      first = i + 2;
      for (j = i + 1; j < len; j++) {
        if (str[j] < str[i + 1]) {
          last = j + 1;
          flag = 1;
          break;
        }
      }
    }
    if (flag == 1) break;
  }
  if (flag == 1) {
    printf("YES\n");
    printf("%ld %ld", first, last);
  } else
    printf("NO");
  return 0;
}
