#include <bits/stdc++.h>
using namespace std;
int N;
char str[300005];
int main() {
  cin >> N;
  cin >> str[0];
  int mn = str[0], flag = 0, start;
  for (int i = 1; i < N; i++) {
    cin >> str[i];
    if (mn > str[i] && !flag) {
      flag = 1;
      start = i;
    }
    if (mn <= str[i]) mn = str[i];
  }
  if (flag == 1) {
    cout << "YES" << endl;
    cout << start - 1 << ' ' << start;
  } else
    cout << "NO";
}
