#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  string str, cpy, ans;
  pair<int, int> P;
  cin >> n;
  cin >> str;
  cpy = str;
  reverse(cpy.begin(), cpy.end());
  ans = str;
  sort(cpy.begin(), cpy.end());
  if (cpy == str) {
    cout << "NO";
    return 0;
  } else {
    for (i = 0; str[i]; i++) {
      for (int j = i + 1; j < n; j++) {
        string s1 = str.substr(i, i + j);
        string s2;
        s2 = s1;
        reverse(s1.begin(), s1.end());
        sort(s1.begin(), s1.end());
        if (s1 < s2) {
          ans = s1;
          P.first = i + 1;
          P.second = j + 1;
          cout << "YES\n";
          cout << P.first << ' ' << P.second;
          return 0;
        }
      }
    }
  }
}
