size = int(input())
s = input()

out = "NO"
change = []

for i in range(size -1):
    if s[i] > s[i + 1]:
        out = "YES"
        change = [i, i+1]
        break

print(out)
if len(change) > 0:
    print(*change)