n = int(input())
s = input()
ind = 0
kk = ''
k = 'NO'
for i in range(0,len(s)-1):
    if s[i] > s[i+1]:
        kk += s[:i]+s[i:i+2][::-1]+s[i+2:]
        k = 'YES'
        ind = i+1
        break
if k == 'YES':
    print(k)
    print(str(ind)+' '+str(ind+1))
else:
    print(k)