n = int(input())
s = str(input())
lis = []
for i in range(n):
    lis.append(s[i])
lis.sort()
fix = ''.join(lis)
if s == fix:
    print("NO")
else:
    print("YES")
    for i in range(n):
        if s[i]!=fix[i]:
            print(i+1, end=" ")
            for j in range(i+1, n):
                if s[j] == fix[i]:
                    print(j+1)
                    break
            break
