n = int(input())
s = input()
a = [ord(x) for x in s]
Max = a[0]
index=0
for i in range(1, n):
    if a[i] < Max:
        print("YES")
        print(index+1,end=" ")
        print(i+1)
        exit()
    if a[i] > Max:
        index=i
        Max = a[i]
print("NO")
