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