n = int(input())
s = input().strip()

for idx in range(1, len(s)):    
    if ord(s[idx]) >= ord(s[idx-1]):
        pass
    else:
        print("YES")
        print("{} {}".format(idx, idx + 1))
        exit(0)

print("NO")

