#pragma region Macros
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).rbegin(), (x).rend())
#define ALL(x) (x).begin(), (x).end()
#define REV(x) reverse(ALL(x))
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define SP << " " <<
#define INF2 1000000000000000037
#define INF  1000000007
#define lwb(x,n) distance(x.begin(),lower_bound(ALL(x),(n)))
#define upb(x,n) distance(x.begin(),upper_bound(ALL(x),(n)))
#define fora(i, ...) if(ll i = -1) for(__VA_ARGS__) if(i++, true)
#ifdef _MY_DEBUG
#define isdebug true
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define de(...) CHOOSE((__VA_ARGS__,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define isdebug false
#define de(...)
#endif
using namespace std;
using ll = long long;
using ld = long double;
const ld PI = 3.14159265358979323846;
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
template<class T = ll> using v = vector<T>;
template<class T = ll> using vv = vector<vector<T>>;
template<class T = ll> using vvv = vector<vector<vector<T>>>;
template<class T> bool maxi(T &a, const T &b){ if(a<b){a=b;return 1;}return 0;}
template<class T> bool mini(T &a, const T &b){ if(b<a){a=b;return 1;}return 0;}
template<class T> ll sumer(const T& a){ return accumulate(ALL(a),0LL); }
template<class T> void UNIQUE(vector<T> &a){ SORT(a);a.erase(unique(ALL(a)),a.end());}
template<class T, class U> ostream &operator<<(ostream &os, const pair<T,U> &pe) { os << pe.first << " " << pe.second; return os;}
template<class T> ostream &operator<<(ostream &os, const v<T> &ve) { rep(i,ve.size()) os<< (i?" ":"")<<ve[i]; return os;}
ll topbit(ll a) { return a==0?-1:63-__builtin_clzll(a);}
ll botbit(ll a) { return a==0?64:__builtin_ctzll(a);}
ll popcount(ll a) { return __builtin_popcountll(a);}
#define dame {cout<< retword <<"\n"; return;}
#pragma endregion
//--MODIFS---------------------------------
#pragma region Modifs
#define retword "No"
#define MOD  1000000007
const ld EPS = 1e-9;
using P  = pair<ll,ll>;
using TP  = tuple<ll,ll,ll>;
#pragma endregion
//--GLOBAL---------------------------------
template <class Mono>
struct SegTree{
    int N;
    Mono unitMono; //初期値であり単位元
    vector<Mono> dat;

    SegTree(int n) : unitMono(Mono ()) {
        N = 1;
        while(N < n) N <<= 1;
        dat.resize(2*N-1, unitMono);
    }

    void set(int i, const Mono &val) { dat[i+N-1] = val; }
    void build() {
        repr(k,N-2,0) dat[k] = operation(dat[k*2+1], dat[k*2+2]);
    }

    void update(int i, const Mono &val) { // 0-indexed
        i += (N - 1); //最下段に移動
        dat[i] = setval(dat[i],val);
        while(i > 0) { //上に向かって更新
            i = (i - 1) / 2;
            dat[i] = operation(dat[i*2+1], dat[i*2+2]);
        }
    }

    Mono _query(int a, int b, int k, int l, int r) {
        // [a,b)をみる。現在k,範囲[l,r)。0-indexed。
        if(r <= a or b <= l) return unitMono; //範囲外
        if(a <= l and r <= b) return dat[k]; //被覆
        Mono vl = _query(a, b, 2*k+1, l, (l+r)/2);
        Mono vr = _query(a, b, 2*k+2, (l+r)/2, r);
        return operation(vl, vr);
    }

    Mono query(int a, int b){ //[a,b)
        return _query(a,b,0,0,N);
    }

    inline Mono operator[](int i){
        return dat[i+N-1];
    }

};

// RMQ
struct MONO{
    ll val=-1;
    ll iti=0;
};
MONO operation(MONO a, MONO b){
    if(a.val>=b.val) return a;
    else return b;
};
MONO setval(MONO a, MONO b){
    return b;
};

priority_queue<int> sta[505050];

//--MAIN-----------------------------------
void Main() {
    ll N;
    cin>>N;
    v<string> S;
    ll mig,hid=0;
    rep(i,N){
        string x; cin>>x;
        ll mi=0,hi=0;
        rep(j,x.size()){
            if(x[j]=='(') {
                ++hid;
                ++hi;
            }
            else {
                ++mig;
                if(hi>0) --hi;
                else ++mi;
            }
        }
        sta[mi].emplace(hi);
    }
    if(mig!=hid) dame;
    // de(1);
    SegTree<MONO> seg(505050);
    rep(i,505050){
        if(sta[i].empty()) continue;
        ll x=sta[i].top();
        sta[i].pop();
        MONO y={x,i};
        seg.set(i,y);
    }
    seg.build();
    ll now=0;
    rep(i,N){
        MONO y=seg.query(0,now+1);
        if(y.val==-1) dame;
        ll x=y.iti;
        now=now-x+y.val;
        MONO ire;
        if(sta[x].empty()) ire.val=-1;
        else{
            ire.val=sta[x].top();
            ire.iti=x;
            sta[x].pop();
        }
        seg.update(x,ire);

    }
    cout<< "Yes"<<"\n";

    
}
//--START----------------------------------
int main() {
    cin.tie(nullptr); ios_base::sync_with_stdio(false);
    // if(isdebug) {ifstream in("input.txt"); cin.rdbuf(in.rdbuf());}
    // if(isdebug) {ofstream out("output.txt"); cout.rdbuf(out.rdbuf());}
    cout << fixed << setprecision(15);
    // ll Qkai; cin>>Qkai; rep(QQ,Qkai) Main();
    Main();
}
//-----------------------------------------

Measured memory_bytes: 39504