input()
a = input()
b = "".join(sorted(a))
if a == b:
    print('NO')
else:
    print('YES')
    for i in range(len(a)-1):
        if ord(a[i]) > ord(a[i+1]):
            f = i
            break
    print(f+1,f+2)