n = int(input())
c = list(input().lower())
j = str(c[0])
ans = -1
for v,i in enumerate(c):
    if i < j:
        ans = v
        print('YES')
        break
    j = i
if ans == -1:
    print('NO')
else:
    print(ans,ans+1)