#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

n = int(input())
s = input()
m = ord(s[0])
p = 0

for i in range(n):
    if ord(s[i]) > m:
        m = ord(s[i])
        p = i
    if ord(s[i]) < m:
        print('YES')
        print(p+1, i+1)
        exit()

print('NO')
