


size = int(raw_input())
str = str(raw_input())
k = 0
for i in range(1, size):
    if (ord(str[i]) < ord(str[i - 1])):
        print ("YES")
        j = i + 1
        print i," ",j
        k = 100
        break
if (k == 0):
    print("NO")
