#include <bits/stdc++.h>
using namespace std;
int n, pos1, pos2;
char pre, tmp;
int main() {
  scanf("%d\n%c", &n, &pre);
  for (int i = 1; i < n; i++) {
    scanf("%c", &tmp);
    if (tmp < pre) pos1 = i - 1, pos2 = i;
    pre = tmp;
  }
  if (pos1)
    printf("YES\n%d %d\n", pos1, pos2);
  else
    printf("NO\n");
  return 0;
}
