n = int(input().strip())
string = input().strip()
first,last = 0,0
has = False
for i in range(1,n):
    if string[i] < string[i-1]:
        first = i
        last = i + 1
        has = True
        break

if has:
    print("YES")
    print(first,last)
else:
    print("NO")
