length = int(input())
string = input()

for i in range(length-1):
    if ord(string[i])>ord(string[i+1]):
        print("YES")
        print(str(i+1)+" "+str(i+2))
        break
    if i==length-2:
        print("NO")
        break
