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