#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] < s[i + 1]) {
      for (int j = i + 2; j < n; j++) {
        if (s[j] < s[i + 1]) {
          cout << "YES"
               << "\n"
               << i + 1 << " " << j;
          count++;
          break;
        }
      }
    }
    if (count != 0) break;
  }
  if (count == 0) cout << "NO";
}
