#include <bits/stdc++.h>
#define ll long long
#define nl '\n'
#define ar array
#define AC ios_base::sync_with_stdio(0); cin.tie(NULL);
using namespace std;
const int MOD = 998244353;
const int N = 1e6;
const int DIST_MAX = 2147483647;

struct mi {
	ll v; explicit operator ll() const { return v; }
	mi() { v = 0; }
	mi(ll _v) { 
		v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD;
	}
	friend bool operator==(const mi& a, const mi& b) { 
		return a.v == b.v; }
	friend bool operator!=(const mi& a, const mi& b) { 
		return !(a == b); }
	friend bool operator<(const mi& a, const mi& b) { 
		return a.v < b.v; }
   
	mi& operator+=(const mi& m) { 
		if ((v += m.v) >= MOD) v -= MOD; 
		return *this; }
	mi& operator-=(const mi& m) { 
		if ((v -= m.v) < 0) v += MOD; 
		return *this; }
	mi& operator*=(const mi& m) { 
		v = v*m.v%MOD; return *this; }
	mi& operator/=(const mi& m) { return (*this) *= inv(m); }
	friend mi pow(mi a, ll p) {
		mi ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans;
	}
	friend mi inv(const mi& a) { assert(a.v != 0); 
		return pow(a,MOD-2); }
		
	mi operator-() const { return mi(-v); }
	mi& operator++() { return *this += 1; }
	mi& operator--() { return *this -= 1; }
    mi operator++(int) { mi temp; temp.v = v++; return temp; }
    mi operator--(int) { mi temp; temp.v = v--; return temp; }
	friend mi operator+(mi a, const mi& b) { return a += b; }
	friend mi operator-(mi a, const mi& b) { return a -= b; }
	friend mi operator*(mi a, const mi& b) { return a *= b; }
	friend mi operator/(mi a, const mi& b) { return a /= b; }
    friend ostream& operator<<(ostream& os, const mi& m) {
        os << m.v; return os;
    }
    friend istream& operator>>(istream& is, mi& m) {
        ll x; is >> x;
        m.v = x;
        return is;
    }
};



bool comp1(const ar<int,2>& a, const ar<int,2>& b){
    return a[0]<b[0];
}
bool comp2(const ar<int,2>& a, const ar<int,2>& b){
    return a[1]>b[1];
}


int main(){
    AC
    int n;
    cin>>n;
    int all_open = 0;
    int all_closed = 0;
    vector<ar<int,2>> increase;
    vector<ar<int,2>> decrease;
    for(int i=0; i<n; i++){
        string s;
        cin>>s;
        stack<char> stk;
        int open_cnt = 0;
        int closed_cnt = 0;
        for(char c : s){
            if(c=='('){
                stk.push(c);
                open_cnt++;
            }
            else{
                if(!stk.empty()&&stk.top()=='('){
                    stk.pop();
                    open_cnt--;
                }
                else{
                    stk.push(c);
                    closed_cnt++;
                }
            }
        }
        if(open_cnt-closed_cnt>=0)
            increase.push_back({closed_cnt, open_cnt});
        else
            decrease.push_back({closed_cnt, open_cnt});
    }
    sort(increase.begin(), increase.end(), comp1);
    sort(decrease.begin(), decrease.end(), comp2);

    increase.insert(increase.end(), decrease.begin(), decrease.end());

    int ans = 0;
    for(auto d : increase){
        ans-=d[0];
        if(ans < 0){
            cout<<"No"<<endl;
            return 0;
        }
        ans+=d[1];
    }
    if(ans==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}

Measured memory_bytes: 18904