x=int(input())
p=input()
for i in range(x-2):
    k=p[:i]+"".join(reversed(p[i:i+3]))+p[i+3:]
    if k<p:
        print("YES")
        exit(print(i,i+3))     
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 ...


