# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())
S = input()[:-1]
prev = S[0]
ans = "NO"
for i, c in enumerate(S[1:], 1):
    if prev <= c:
        prev = c
        continue
    else:
        print("YES")
        print(i, i+1)
        exit()
print(ans)
