n = int(input())
s = input()
last = s[0]
f=0
for i in range(n):
    if(s[i]<last and s[0:i+1][::-1]!=s[0:i+1]):
        print('YES')
        print(1, i+1)
        f = 1
        break
    else:
        last = s[i]
if(f==0):
    print('NO')
