def main():
    len = int(input())
    s = str(input())
    for i in range(0,len-1):
        if s[i] > s[i+1]:
            print('YES')
            print(i+1, ' ', i+2)
            return
    print('NO')


if __name__ == '__main__':
    main()
