#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, check = 0, i, j;
  cin >> n;
  char str[n + 1];
  cin >> str;
  for (i = 0; i < n - 1 && check == 0; i++) {
    if (str[i] > str[i + 1]) check++;
  }
  if (check == 0)
    cout << "NO" << endl;
  else
    cout << "YES\n" << i - 1 << " " << i << endl;
}
