def METHOD_NAME(tags):
    tag_map = {"BB": "S", "BO": "S", "IB": "E", "IO": "E"}
    tags = tags + ["O"]
    iobes_tags = []
    for i in range(len(tags) - 1):
        tagtag = tags[i][0] + tags[i + 1][0]
        if tagtag in tag_map:
            iobes_tags.append(tag_map[tagtag] + tags[i][1:])
        else:
            iobes_tags.append(tags[i])
    return iobes_tags