n = int(input())
s = list(input())
flag = False
ans = 0
for i in range(n-1):
    if s[i] <= s[i+1]:
        pass
    else:
        s[i],s[i+1] = s[i+1],s[i]
        ans = [i+1,i+2]
        flag = True
        break
if flag:
    print('YES')
    print(ans[0],ans[1])
else:
    print('NO')