n = int(input())
s = input()

flag = False
#start, stop = -1
for i in range(n-1):
    if s[i]>s[i+1]:
        flag = True
        print("YES")
        print(i+1, i+2)
        break

if not flag:
    print("NO")     
