n = int(input())

s = input()

left = -1
right = -1

for i in range(1, n):
    if (s[i - 1] > s[i]):
        left = i - 1
        right = i
        break
if (left >= 0 and right >=0):
    print("YES")
    print(left + 1, right + 1)
else:
    print("NO")