n = int(input())
temp = input()
a = temp[0]
b = 0
ans = False
for i in range(n):
    if a < temp[i]:
        a = temp[i]
    elif a > temp[i]:
        b = i
        ans = True
        break
if ans:
    print("YES")
    print(str(b), str(b+1))
else:
    print("NO")