class ReverseSubstring():
    def __init__(self, n, s):
        self.n, self.s = n,s

    def move(self):
        for i in range(self.n-1):
            if self.s[i] > self.s[i+1]:
                return True, (i+1,i+2)
        return False, ()

n = int(input())
s = input().strip()
check, move = ReverseSubstring(n,s).move()
if check:
    print('YES')
    print(*move)
else:
    print('NO')