n=int(input())
s=input()
k=0
x=s[0]
for i in range(1,n):
    if s[i]>=s[i-1]:
        continue
    else:        
        k=1
        break
if k==0:
    print("NO")
else:
    print("YES")
    print(i,i+1)
    
