a = "a"
o = input()
inp = [i for i in input()]
inn = -1
flag = 1
for i in range(len(inp)):
    if not flag:
        if inp[i] < a:
            print("YES")
            print(inn + 1, i + 1)
            break
    if inp[i] > a and flag:
        a = inp[i]
        inn = i
        flag = 0
else:
    print("NO")