import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;


void main() {
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;

    foreach (i; 0..N-1) {
        if (S[i] > S[i+1]) {
            writeln("YES");
            writeln(i+1, " ", i+2);
            return;
        }
    }

    writeln("NO");
}