#include <bits/stdc++.h>
int main() {
  long long int n;
  int pos = 0, k = 0;
  scanf("%lld", &n);
  char s[n], x[1], y[1];
  scanf("%s", s);
  if (n == 1 || n == 0) {
    pos = -1;
  }
  for (int i = 0; i < n - 1; i++) {
    x[0] = s[i];
    y[0] = s[i + 1];
    k = strcmp(x, y);
    if (k > 0 && k < 2) {
      pos = i;
      break;
    } else
      pos = -1;
  }
  if (pos >= 0) {
    printf("YES\n%d %d", pos + 1, pos + 2);
  } else {
    printf("NO");
  }
}
