#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int j = n - 1;
  bool f = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s[i] > s[i + 1]) {
      puts("YES");
      cout << i + 1 << " " << i + 2 << '\n';
      f = 1;
      break;
    }
  }
  if (!f) puts("NO");
}
