n=int(input())
a=input()
a=[ord(i)-ord('a') for i in a]
k=-1
for i in range(n-1):
    if a[i]>a[i+1]:
        k=i  
        break  
if(k==-1):
    print('NO')
else:
    print('YES')
    print(k+1,k+2)
