n = int(input())
s = input()
yes = False
for i in range(n-1):
    if s[i] > s[i+1]:
        yes = True
        print("YES")
        print(str(i+1) + " " + str(i+2))
        break
if not yes:
    print("NO")
