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

flag = True
for i in range(1,len(s)):
    if(s[i-1]>s[i]):
        flag = False
        print("YES")
        print(i,i+1)
        break
        
    
    

if(flag):
    print("NO")
    
