n= int(input())
s = input()
for i in range(1, n):
    if ord(s[i])-ord(s[i-1])>=0:
        continue
    else:
        print('YES')
        print(str(i)+' '+str(i+1))
        exit(0)
print('NO')
        
        