n = int(input())

string = input()

i = 1
able = 0
for i in range(1,n):
    if string[i] >= string[i - 1]:
        i += 1 
    else:
        able = 1
        break

if able == 1:
    print("YES")
    print(i, end = " ")
    print(i + 1)
else:
    print("NO")