t = int(input())
s = input()
b = False
for i in range(len(s)-1):
    if ord(s[i])>ord(s[i+1]):
        print("YES")
        print(i+1," ",i+2)
        b = True
        break
if b == False :
    print("NO")
