#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string arr;
  cin >> arr;
  string frr = arr;
  sort(frr.begin(), frr.end());
  for (int i = 0; i < arr.size(); i++) {
    if (frr[i] != arr[i]) {
      for (int j = 0; j < arr.size(); j++) {
        if (frr[i] == arr[j]) {
          cout << "YES" << endl;
          cout << i + 1 << " " << j + 1 << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
}
