n = int(input().strip())
s = input().strip()
i = 0
j = n - 1
hasSol = False
a = 0; b = 0
while(i < j):
    if s[i] <= s[j]:
        i += 1
    else :
        hasSol = True
        a = i; b = j
        break
    if hasSol:
        print("YES")
        print(a, b)
    else:
        print("NO")