a = input()
b = input()
a = int(a)
b = str(b)
yes = 0
for i in range(a-1):
    #print (ord(b[i]))
    if ord(b[i]) > ord(b[i+1]):
        #print (ord(b[i]), ord(b[i+1])) 
        yes = 1
        mem = i
#print (ord(b[a-1]))
if yes == 1:
    print ("YES")
    print (mem+1, mem+2)
else: 
    print ("NO")