N = int(input())

string = list(input())

def test():
    for x in range(0, len(string)):
        for y in range(x + 1, len(string)):
            print(string[x], string[y])
            if ord(string[y]) < ord(string[x]):
                return (x, y + 1)

value = test()

if value and "".join(string) != "".join(len(string) * string[0]):
    print("YES")
    print(value[0], value[1])
else:
    print("NO")