#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    n = int(raw_input())
    s = raw_input()
    pos = [-1] * 26
    for c in xrange(n):
        o = ord(s[c]) - ord('a')
        for x in xrange(o + 1, 26):
            if pos[x] != -1:
                print 'YES'
                print pos[x] + 1, c + 1
                return
        pos[o] = c

    print 'NO'
    return

main()