n=int(input())
s=input()
for i in range(n-1):
    if s[i+1]<s[i]:
        # a=list(s)
        # a[i],a[i+1]=a[i+1],a[i]
        # s=''.join(a)
        # print(s)
        print("YES")
        print(i+1,i+2)
        break
else:print("NO")