N = int(input())

string = list(input())

last = string[-1]

c_index = 0

for index in range(0, N):
    if ord(string[index]) < ord(string[c_index]):
        print("YES")
        print(c_index + 1, index +1)
        break
    elif ord(string[index]) > ord(string[c_index]):
        c_index = index
else:
    print("NO")