#include <bits/stdc++.h>
using namespace std;
inline long long re() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int main() {
  int n = re();
  string s;
  cin >> s;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] < s[i - 1]) {
      puts("YES");
      cout << i - 1 << ' ' << i;
      return 0;
    }
  }
  puts("NO");
}
