n = int(input())

s = input()


max_read = "a"
max_ind = 0

f = -1

for i in range(n):
    if s[i] < max_read:
        # found
        f = i
        break

    if s[i] > max_read:
        max_read = s[i]
        max_ind = i


if f == -1:
    print("NO")
else:
    print("YES")
    print(max_ind + 1, f + 1)
