//package abc167.F

import java.io.*
import java.math.*
import java.util.*
import kotlin.math.*

var reader: BufferedReader = System.`in`.bufferedReader()
var writer: PrintWriter = PrintWriter(System.`out`)

fun next() = reader.readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextStrings() = next().split(" ")
fun nextInts() = nextStrings().map { it.toInt() }
fun nextLongs() = nextStrings().map { it.toLong() }
fun nextDoubles() = nextStrings().map { it.toDouble() }

fun put(v: Any?) = writer.print(v)
fun puts() = writer.println()
fun puts(v: Any?) = writer.println(v)

var debug = false
fun dp(v: Any?) {
    if (debug) println(v)
}
fun dp() {
    if (debug) println()
}

fun test(case: Int, input: String, expected: String) {
    reader = input.trimIndent().reader().buffered()

    val stringWriter = StringWriter()
    writer = PrintWriter(stringWriter)

    solve()
    writer.flush()

    val actual = stringWriter.toString()

    println("[test $case]")
    if ("${expected}" == actual) {
        println("OK")
    } else {
        println("NG")
        println()
        println("expected: \"${expected}\"")
        println("actual:   \"${actual}\"")
    }
    println()
}

@Suppress("UNUSED_PARAMETER")
fun xtest(case: Int, input: String, expected: String) {}

fun main(args: Array<String>) {
    if ((args.size == 1) && (args[0] == "test")) {
        testAll()
    } else {
        solve()
        writer.flush()
    }
}

///////////////////////////////////////////////////////////

fun testAll() {
    debug = true

    test(1,
    """
    2
    )
    (()
    """,
    "Yes"
    )
    test(2,
    """
    2
    )(
    ()
    """,
    "No"
    )
    test(3,
    """
    4
    ((()))
    ((((((
    ))))))
    ()()()
    """,
    "Yes")
    test(4,
    """
    3
    (((
    )
    )
    """,
    "No")
    test(5,
    """
    3
    (
    )
    ))((
    """,
    "No")
    test(6,
    """
    4
    (
    )
    ))(
    )((
    """,
    "Yes")
    test(7,
    """
    4
    (
    ))
    )(
    )((
    """,
    "Yes")
    test(8,
    """
    4
    ((
    )
    ))(
    )(
    """,
    "Yes")
    test(9,
    """
    4
    (((
    )))
    )(
    ))))))))))((((((((((
    """,
    "No"
    )
    test(10,
    """
    5
    (((
    )))
    ))((((((((((
    ))))))))))(((
    ))))))))))(((((((((
    """,
    "Yes"
    )
    test(11,
    """
    4
    ((((((((((
    )))(
    )))))))))((
    )
    """,
    "Yes"
    )
    test(12,
    """
    4
    ((((((((((
    )))((((
    )))))))))))(
    )
    """,
    "Yes"
    )
    test(13,
    """
    4
    ((((((((((
    )((
    )))))))))))(((((
    )))))
    """,
    "Yes"
    )
    test(14,
    """
    5
    ((((((((((
    )((
    )))))(((
    )))))))))))(((((
    )))
    """,
    "Yes"
    )
}

typealias Seq = Pair<Int, Int>

fun doSolve(): Boolean {

    val N = nextInt()

    var total = 0
    var totalL = 0
    var totalR = 0

    val Mp = mutableListOf<Seq>()
    val Mm = mutableListOf<Seq>()

    repeat(N) {
        var r = 0
        var l = 0
        var pre = true

        val str = next()
        for (c in str) {
            if (c == '(') {
                pre = false
                ++total
                ++l
            } else {
                --total
                if (pre) {
                    ++r
                } else {
                    --l
                }
            }
        }
        if (l < 0) {
            r += -l
            l = 0
        }

        if ((l == 0) && (r > 0)) {
            totalR += r
        }
        if ((r == 0) && (l > 0)) {
            totalL += l
        }

        if ((l > 0) && (r > 0)) {
            if (r < l) {
                Mp.add(Seq(r, l))
            } else {
                Mm.add(Seq(r, l))
            }
        }

        //dp("[$l, $r]: $totalL - $totalR")
    }

    if (total != 0) {
        dp("pat1(NG)")
        return false
    }
    if (Mp.isEmpty() && Mm.isEmpty()) {
        dp("pat2(OK)")
        return true
    }

    Mp.sortWith(compareBy(Seq::first))
    Mm.sortWith(compareByDescending(Seq::first)
        .thenByDescending(Seq::second))

    //dp(Mp)
    //dp(Mm)

    total = totalL
    for (seq in Mp) {
        //dp("seq(p): $total, $seq")

        if (total < seq.first) {
            dp("pat3(NG)")
            return false
        }

        total -= seq.first
        total += seq.second
    }
    for (seq in Mm) {
        //dp("seq(m): $total, $seq")

        if (total < seq.first) {
            dp("pat3(NG)")
            return false
        }

        total -= seq.first
        total += seq.second
    }
    //dp("$total")

    if (total == totalR) {
        dp("pat4(OK)")
        return true
    }

    dp("pat5(NG)")
    return false
}

fun solve() {
    if (doSolve()) {
        put("Yes")
    } else {
        put("No")
    }
}


Measured memory_bytes: 57872