#include <bits/stdc++.h>
using namespace std;
int arr[27] = {0};
int main() {
  int len;
  string s;
  cin >> len;
  cin >> s;
  for (int i = 1; i < len; i++) {
    arr[s[i] - 'a'] = i + 1;
  }
  bool flag = false;
  for (int j = 0; j < 27; j++) {
    if (arr[j] != 0 && flag == false) {
      for (int k = j + 1; k < 27; k++) {
        if (arr[k] < arr[j]) {
          cout << "YES"
               << "\n";
          cout << arr[k] << " " << arr[j] << "\n";
          flag = true;
          break;
        }
      }
    }
    if (flag) break;
  }
  if (!flag)
    cout << "NO"
         << "\n";
  return 0;
}
