#include <bits/stdc++.h>
using namespace std;
char maxx = 0;
int maxx_p = 0;
int main() {
  int n;
  cin >> n;
  cin >> maxx;
  for (int i = 1; i < n; i++) {
    char tmp;
    cin >> tmp;
    if (tmp > maxx) {
      maxx = tmp;
      maxx_p = i;
    } else {
      printf("YES\n%d %d\n", maxx_p + 1, i + 1);
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
