inp = lambda cast=int: list(map(cast, input().split()))
n, = inp()
s, = inp(str)
for i in range(0, n-1):
    if s[i] > s[i+1]:
        print('YES')
        print(i+1, i+2)
        break
else:
    print('NO')