fun main(args: Array<String>) {
    val s = readLine()!!
    val map = mutableMapOf<Char, Int>()
    for (c in s) {
        if (map.containsKey(c)) {
            map[c] = map[c]!! + 1
        } else {
            map[c] = 1
        }
    }
    println(if (map.values.all { it == 2 }) "Yes" else "No")
}
