n = int(input())
s = input()
mn_list = [None] * n
mn_list[n-1] = n - 1
for i in range(1, n):
    mn_list[n-i-1] = mn_list[n-i]
    if s[mn_list[n-i-1]] > s[i]:
        mn_list[n-i-1] = i

def handle():
    for i in range(0, n):
        if s[i] != s[mn_list[i]]:
            print("YES")
            print(i+1, mn_list[i] +1)
            return
    print("NO")

handle()