n = int(input())
a = list(input())
work = False
l,r = 0,0
l = 1
lv = ord(a[0])
for i in range(1,len(a)):
    if ord(a[i])>=lv:
        lv = ord(a[i])
        l = i+1
    else:
        r = i+1
        work = True
        break
if work:
    print("YES")
    print(l,r)
else:
    print("NO")