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