def is_same(k,s2):
    if k == 300000 and s2[0] == 'a':
        return 1
    return 0

def main():
    n = int(input())
    s1 = input()
    flag = 1
    if is_same(n,s1):
        print('NO')
        return
    for i in range(n):
        for j in range(i+1,n,+1):
            if s1[j] < s1[i]:
                print('YES')
                print(str(i+1) + " " + str(j+1) )
                return
    print('NO')


if __name__ == '__main__':
    main()
