n = int(input())
s = list(input())
ruined = 0
table = []
for i in range(n-1):
    if s[i]>s[i+1]:
        ruined=1
        table = [i+1,i+2]
if not ruined:
    print("NO")
else:
    print("YES")
    print(*table)