number = input("")
num=int(number)
string=input()
length=len(string)
for i in range(0,length):
    for j in range(i+1,length):
        s=str(string[i:j+1:1])
        rev=s[::-1]
        if s < string:
            print("YES")
            print(i,j)
            found="TRUE"
            break
    if found == "TRUE":
        break
if found != "TRUE":
    print("NO")