#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ptr1 = 0, ptr2 = 1;
  int pos = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'a') {
      pos = i;
      break;
    }
  }
  ptr1 = pos, ptr2 = pos + 1;
  bool f = false;
  for (int i = pos; i < s.size(); i++) {
    if (ptr2 < s.size()) {
      int digit1 = (int)s[ptr1];
      int digit2 = (int)s[ptr2];
      if (digit2 < digit1) {
        f = true;
        break;
      } else {
        ptr2++;
      }
    }
  }
  if (f) {
    cout << "YES" << endl;
    cout << ptr1 + 1 << " " << ptr2 + 1 << endl;
  } else {
    cout << "NO" << endl;
  }
}
