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

for i in range(n):
    if i + 1 == n:
        break
    a = s[i:i+2]
    b = s[i+1] + s[i]
    if b < a:
        print('YES')
        print(i+1, i+2)
        exit(0)
print("NO")
