#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, o, p, n;
  string s;
  l = 1;
  cin >> n;
  cin >> s;
  k = 0;
  for (long long int i = 1; i <= s.size() - 1; i++) {
    if (s[i] < s[i - 1]) {
      l = 0;
      k = i;
      break;
    }
  }
  if (l == 1)
    cout << "NO";
  else
    cout << "YES\n" << k + 1 << " " << k + 2;
  return 0;
}
