#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

// 根が1
template<typename Monoid>
struct segtree {
    using T = typename Monoid::T;
    int n;
    vector<T> dat;

    segtree(int n_) {
        n = 1;
        while(n < n_) n <<= 1;
        dat.assign(n*2, Monoid::id());
    }
    void build(vector<T> v) {
        REP(i, v.size()) dat[i+n] = v[i];
        for(int i=n-1; i>0; --i) dat[i] = Monoid::op(dat[i*2], dat[i*2+1]);
    }

    T query(int a, int b) {
        if(a >= b) return Monoid::id();
        T l = Monoid::id(), r = Monoid::id();
        for(a+=n, b+=n; a<b; a>>=1, b>>=1) {
            if(a&1) l = Monoid::op(l, dat[a++]);
            if(b&1) r = Monoid::op(dat[--b], r);
        }
        return Monoid::op(l, r);
    }
    void update(int i, T v) {
        i += n;
        dat[i] = v;
        while(i >>= 1) {
            dat[i] = Monoid::op(dat[i*2], dat[i*2+1]);
        }
    }

    friend ostream &operator <<(ostream& out,const segtree<Monoid>& seg){
        out << "---------------------" << endl;
        int cnt = 1;
        for(int i=1; i<=seg.n; i*=2) {
            REP(j, i) {
                out << seg.dat[cnt] << " ";
                cnt++;
            }
            out << endl;
        }
        out << "---------------------" << endl;
        return out;
    }
};

template<typename Tp>
struct max_monoid {
    using T = Tp;
    static constexpr Tp id() { return {-INF, -INF}; }
    static Tp op(const Tp &a, const Tp &b) { return max(a, b); }
};

int main(void) {
    ll n;
    cin >> n;
    vector<string> s(n);
    REP(i, n) cin >> s[i];

    vector<PII> v;
    REP(i, n) {
        ll now = 0, mi = 0;
        REP(j, s[i].size()) {
            if(s[i][j]=='(') now++;
            else now--;
            chmin(mi, now);
        } 
        v.push_back({mi, now});
    }

    auto solve1 = [](vector<PII> vp) {
        ll n = vp.size();
        sort(ALL(vp));
        segtree<max_monoid<PII>> seg(n);
        vector<PII> init(n);
        REP(i, n) init[i] = {vp[i].second, i};
        seg.build(init);

        vector<ll> x(n);
        REP(i, n) x[i] = vp[i].first;

        dump(vp);

        ll sum = 0;
        REP(i, n) {
            // sum + x[j] >= 0 となる最小のj
            // x[j] >= -sum
            ll j = lower_bound(ALL(x), -sum) - x.begin();
            dump(j);
            dump(sum);
            dump(seg);
            PII p = seg.query(j, n);
            if(p.first == -INF) {
                return -INF;
            }
            sum += p.first;
            seg.update(p.second, PII(-INF, p.second));
        }

        return sum;
    };

    vector<PII> plus, minus;
    REP(i, v.size()) {
        if(v[i].second > 0) plus.push_back(v[i]);
        else minus.push_back(v[i]);
    }

    dump(plus);
    dump(minus);

    ll sum = solve1(plus);
    dump(sum);
    if(sum < 0) {
        cout << "No" << endl;
        return 0;
    }

    auto solve = [](vector<PII> vp, ll sum) {
        REP(i, vp.size()) {
            if(sum + vp[i].first < 0) {
                return false;
            }
            sum += vp[i].second;
        }
        return sum == 0;
    };

    sort(ALL(minus));
    if(solve(minus, sum)) {
        cout << "Yes" << endl;
        return 0;
    }

    sort(ALL(minus), [&](PII l, PII r){
        return l.first - l.second < r.first - r.second;
    });
    if(solve(minus, sum)) {
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 108852