n = int(input())
row = list(input())
res = 'NO'
l = 0
for i in range(n - 1):
    if row[i] > row[i + 1]:
        l = i
        res = 'YES'
        break
print(res)
if res == 'YES':
    print(l + 1, l + 2)