n = int(input())
s = input()
a = list(s)
b = sorted(a)
flag = False
for i in range(n):
    if ord(b[i]) != ord(a[i]):
        flag = True
if flag:
    print('Yes')
    for i in range(n-1):
        if ord(s[i+1]) < ord(s[i]):
            ans = [i+1, i+2]
            break
    print(*ans)
else:
    print('No')
