#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, a, b;
  string s;
  cin >> n;
  cin >> s;
  bool flag = 0;
  for (int i = 1; i < n - 1; i++) {
    if (s[i] > s[i + 1]) {
      a = i + 1;
      b = i + 2;
      flag = 1;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl;
    cout << a << " " << b << endl;
    ;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
