n = int(input())
s = list(input())

l = 1
r = len(s)-1

flag = False
while l<=r:
    if(s[l::][::-1]<s):
        flag = True
        break
    l+=1
if(flag):
    print("YES")
    print(l,r)
else:
    print("NO")
