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