#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool ok = false;
  int l = 0, r = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] < s[i - 1]) {
      l = i - 1, r = i;
      ok = true;
      break;
    }
  }
  if (ok) {
    cout << "YES\n" << l << " " << r << "\n";
  } else {
    cout << "NO\n";
  }
}
