n = int(input())
s = input()
mx = -1
for i in range(n):
    if ord(s[i])<mx:
        print('YES')
        print(ind,i+1)
        break
    elif ord(s[i])>mx:
        mx = ord(s[i])
        ind = i+1
else:
    print('NO')