n = int(input())

s = input()

l, r = 0, 0

for i, c in enumerate(s[1:], 1):
    if c < s[l]:
        r = i
        break
    elif c > s[l]:
        l = i
if l >= r:
    print("NO")
else:
    print("YES")
    print(l+1, r+1)

