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

l = 0
r = len(s)-1

flag = False
while l<=r:
    l+=1
    k = s[l:r:]
    if(k[::-1]<k):
        flag = True
        break
    r-=1
    k = s[l-1:r:]
    if(k[::-1]<k):
        flag = True
        break
    k = s[l:r:]
    if(k[::-1]<k):
        flag = True
        break
    

if(flag and l!=r):
    print("YES")
    print(l+1,r+1)
else:
    print("NO")
