#include <bits/stdc++.h>
int main() {
  int m;
  scanf("%d\n", &m);
  char b[m + 1];
  gets(b);
  for (int j = 0; j < m; j++)
    if (b[j] > b[j + 1]) {
      printf("YES\n");
      printf("%d %d", j + 1, j + 2);
      return 0;
    }
  printf("NO");
}
