n = int(input().strip())
s = input().strip()
ans = False
for i in range(n - 1):
    if s[i] > s[i + 1]:
        print("YES")
        l = i + 1
        r = l + 1
        print(str(l) + " " + str(r))
        ans = True
        break
if not ans:
    print("NO")