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

flag = 0
mx = ord(s[0])
ind1, ind2 = 1, 0
for i in range(1, n):
    if ord(s[i]) >= mx:
        ind1 = i + 1
        mx = ord(s[i])
    else:
        ind2 = i + 1
        flag = 1
        break

if flag == 0:
    print("NO")
else:
    print("YES")
    print(ind1, ind2)
