import kotlin.math.min

fun main() = abc167f()

@OptIn(ExperimentalStdlibApi::class)
fun abc167f() {
    data class Bracket(val lowestHeight: Int, val transition: Int)

    val n = readLine()!!.toInt()
    val brackets = (1..n).map {
        val s = readLine()!!
        var currHeight = 0
        var lowestHeight = 0
        for (c in s) {
            when (c) {
                '(' -> currHeight++
                else -> currHeight--
            }
            lowestHeight = min(lowestHeight, currHeight)
        }
        Bracket(lowestHeight, currHeight)
    }

    var currHeight = 0
    val (positives, negatives) = brackets.partition { it.transition >= 0 }

    fun simulate(list: List<Bracket>): Boolean {
        for ((lowestHeight, transition) in list) {
            if (currHeight + lowestHeight < 0) return false
            currHeight += transition
        }
        return true
    }

    if (!simulate(positives.sortedByDescending { it.lowestHeight })) return println("No")
    if (!simulate(negatives.sortedBy { it.lowestHeight - it.transition })) return println("No")

    val answer = if (currHeight == 0) "Yes" else "No"

    println(answer)
}
