#include <bits/stdc++.h>
using namespace std;

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

// セグメントツリー
// 初期化 SegmentTree<typename> seg(列, 単位元);
template<typename T>
class SegmentTree {
private:
    Int n;
    vector<T> node;
    T ident;
    T f(T x, T y) {
        return x.first >= y.first ? x : y;
    }
public:
    SegmentTree(vector<T> in, T identity_element) : n(in.size()), ident(identity_element) {
        node.resize(n * 2);
        for (Int i = 0; i < n; i++) node[n + i] = in[i];
        for (Int i = n - 1; i >= 1; i--) node[i] = f(node[i<<1|0], node[i<<1|1]);
    }
    void update(Int i, T value) {
        i += n;
        node[i] = value;
        while (i > 1) {
            i >>= 1;
            node[i] = f(node[i<<1|0], node[i<<1|1]);
        }
    }
    // 0-indexed, query(l, r + 1) で使ってね
    T query(Int l, Int r) {
        T ret = ident;
        l += n, r += n;
        while (l < r) {
            if (l & 1) ret = f(ret, node[l++]);
            if (r & 1) ret = f(ret, node[--r]);
            l >>= 1, r >>= 1;
        }
        return ret;
    }
};

int main() {
    Int n;
    cin >> n;
    Int l = 0, r = 0;
    vector<priority_queue<Int>> q(1000001);
    for (Int i = 0; i < (Int)n; i++) {
        string s;
        cin >> s;
        string st = "";
        for (Int j = 0; j < (Int)s.size(); j++) {
            if (not st.empty() and st.back() == '(' and s[j] == ')') {
                st.pop_back();
            } else {
                st.push_back(s[j]);
            }
        }
        if (st.empty()) continue;
        if (st.back() == ')') {
            r += st.size();
        } else if (st.front() == '(') {
            l += st.size();
        } else {
            Int l_cnt = 0, r_cnt = 0;
            for (Int j = 0; j < (Int)st.size(); j++) {
                if (st[j] == '(') {
                    l_cnt++;
                } else {
                    r_cnt++;
                }
            } 
            q[r_cnt].push(l_cnt);
        }
    }
    vector<pair<Int, Int>> a(q.size());
    for (Int i = 0; i < (Int)a.size(); i++) {
        pair<Int, Int> add;
        if (q[i].empty()) {
            add = {0, i};
        } else {
            add = {q[i].top(), i};
        }
        a[i] = add;
    }
    SegmentTree seg(a, {0, -1});
    bool update = true;
    while (update) {
        update = false;
        pair<Int, Int> p = seg.query(0, l + 1);
        if (p.first > 0) {
            update = true;
            q[p.second].pop();
            l -= p.second;
            l += p.first;
            Int add;
            if (q[p.second].empty()) {
                add = 0;
            } else {
                add = q[p.second].top();
            }
            seg.update(p.second, {add, p.second});
        }
    }
    for (Int i = 0; i < (Int)q.size(); i++) {
        if (not q[i].empty()) {
            print("No");
            return 0;
        }
    }
    print(l == r ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 98864