#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5 + 10;
int arr[mxn];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  string str;
  cin >> str;
  int fPos = -1, sPos = -1;
  int i, j;
  char ch = str[0], ch1;
  for (i = 0; i < n; i++) {
    if (str[i] != 'a' and ch != str[i]) {
      fPos = i + 1;
      ch1 = str[i];
      break;
    }
  }
  for (j = i + 1; j < n; j++) {
    if (ch1 > str[j]) {
      sPos = j + 1;
      break;
    }
  }
  if (fPos == -1 or sPos == -1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    cout << fPos << " " << sPos << endl;
  }
  return 0;
}
