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