#include <bits/stdc++.h>
int main() {
  char str[300000];
  int a, i, j, k, l, m;
  scanf("%d", &a);
  scanf("%s", &str);
  for (i = 0; i < (a - 1); i++) {
    for (j = i + 1; j < a; j++) {
      char org[300000] = {[0 ... 299999] = '\0'};
      char rev[300000] = {[0 ... 299999] = '\0'};
      for (l = 0, k = i; k <= j; l++, k++) {
        org[l] = str[k];
      }
      int p, q, r;
      p = strlen(org);
      for (q = 0, r = p - 1; q < p / 2; q++, r--) {
        rev[q] = org[r];
        rev[r] = org[q];
      }
      if ((strcmp(org, rev)) > 0) {
        printf("YES\n%d %d\n", i, j);
        return 0;
      }
    }
  }
  printf("NO\n");
  return 0;
}
