_ = input()
s = input()
if len(s) < 2:
    print("NO")
    exit()

for index, c in enumerate(s[1:], start=1):
    if s[index-1] > s[index]:
        print("YES")
        print(index, index+1)
        exit()

print("NO")
