n = int(input())
s = input()

m = 'z'
for i in range(n-1, -1, -1):
    if s[i] <= m:
        m = s[i]
        ind = i
    else:
        print('YES')
        print(i+1, ind+1)
        exit()
print('NO')