x,p=int(input()),input()
for i in range(x-1):
    if p[i]>p[i+1]:
        exit(print("YES",i+1,i+2))
print("NO")

# My code says who am I
# I want to burn and born at this way
# In my eye there is not any things Except love ...


