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