#include <bits/stdc++.h>
using namespace std;
const int MAX = 30010;
const int INF = -0xfffffff;
const double EPS = 0.0000001;
const int MOD = 1000000007;
int T, N, M;
int main() {
  cin >> N;
  char c;
  char ma = 0;
  int l, r;
  l = r = -1;
  for (int i = 1; i <= N; i++) {
    cin >> c;
    if (c >= ma) {
      ma = c;
      l = i;
    } else {
      r = i;
    }
  }
  if (r == -1) {
    cout << "NO";
  } else {
    cout << "YES"
         << "\n";
    cout << l << " " << r;
  }
  return 0;
}
