l = int(input())
x = input()
flag=1
b = [ord(y) for y in x ]
for i in range(l-1):
    if(b[i]>b[i+1]):
        print("YES")
        print(i+1,i+2,sep=" ")
        flag = 0
        break
if(flag):
    print("NO")