#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  char s[333333];
  cin >> n >> s;
  for (i = 1; i <= n; i++) {
    if (s[i - 1] > s[i]) {
      cout << "YES" << endl << i << " " << i + 1 << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
