input()
a = input()
b = "".join(sorted(a))
if a == b:
    print('NO')
else:
    print('YES')
    f,l = 0,0
    flag = True
    for i in range(len(a)):
        if a[i] != b[i] and flag:
            f = i
            flag = False
        elif a[i] != b[i]:
            l = i
    print(f+1,l+1)