t=int(input())
s=input()
a=[]
for i in range(len(s)):
    a.append(ord(s[i])-97)
maxi=0
flag=-1
for i in range(len(a)):
    if (a[i] >=a[maxi]):
        maxi=i
    else:
        flag=i
        break
if flag==-1:
    print('NO')
else:
    print('YES\n')
    print(maxi+1,' ',flag+1)
        