//prewritten code: https://github.com/antma/algo
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.traits;

void main() {
  auto n = readln.strip.to!int;
  auto s = readln.strip[0 .. n];
  foreach (i; 1 .. n) {
    if (s[i-1] > s[i]) {
      debug stderr.writeln (i);
      writeln ("YES");
      writeln (i, ' ', i + 1);
      return;
    }
  }
  writeln ("NO");
}

