#include <bits/stdc++.h>
using namespace std;
int a[200005];
char s[200005];
int main() {
  int T, n, fl = -1;
  cin >> n;
  scanf("%s", s);
  for (int i = 0; i < n - 1; i++) {
    if (s[i] > s[i + 1]) fl = i;
  }
  if (fl == -1)
    puts("NO");
  else {
    puts("YES");
    printf("%d %d\n", fl, fl + 1);
  }
  return 0;
}
