#include <bits/stdc++.h>
using namespace std;
int a[100001], i, j, k, n, d, pos;
string s;
int main() {
  cin >> n;
  cin >> s;
  s += '}';
  for (int i = 0; i < s.size(); i++) {
    if (s[i] > s[i + 1]) {
      d = 1;
      pos = i;
      break;
    }
  }
  if (d == 1) {
    cout << "YES" << endl << pos + 1 << ' ' << pos + 2;
  } else
    cout << "NO";
}
