n = int(input())
inp = input()
s = ''.join(sorted(inp))
j = 0
if(s==inp):
    print("NO")
else:
    print("YES")
    for i in range(len(inp)):
        
        if(inp[i]!=s[i]):
            j = i
            while(inp[j]!=s[j]):
                j+=1
                
            #print(inp,s)
            print(i+1, i+2)
            break
        
    
