

if __name__ == '__main__':
    l = int(input())
    s = input()
    now = ''
    for i in range(l):
        if s[i] < now:
            print(f'YES\n{i} {i + 1}')
            break
        now = s[i]
    else:
        print('NO')
