N = int(input())
line = input()

check = False
for i in range(1, len(line)):
    if line[i - 1] > line[i]:
        check = True
        break
    
if check:
    print('YES')
    print(i, i + 1)
else:
    print('NO')