#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 0;
  string s;
  for (cin >> n >> s; i < n - 1 && (s[i] <= s[i + 1]); i++)
    ;
  (i == n - 1) ? cout << "NO" : cout << "YES\n" << i << " " << i + 1;
}
