import sys

input = sys.stdin.readline

n = int(input())
s = input().strip()

biggest = ord(s[0])
ind = 0
for i in range(1, n):
    if ord(s[i]) < biggest:
        print("YES")
        print(ind+1, i+1)
        sys.exit(0)
    else:
        biggest = ord(s[i])
        ind = i

print("NO")
