#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 998244353;


const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];



int main() {

	int n;
	cin >> n;

	vector <pair<pair<int,int>,int>> hazime;
	vector <pair<pair<int, int>, int>> owari;
	VS vec;
	VP a;
	

	REP(i, n) {
		int e = 0, f = 0, g = 0, h = 0;
		string s;
		cin >> s;
		vec.push_back(s);
		REP(j, s.size()) {
			if (s[j] == '(')e++;
			else f++;
			g = max(g, e - f);
			h = min(h, e - f);
		}
		bool flag = true;
		if (s[0] == '('&&h >= 0) {
			hazime.push_back({ { e - f,h },i });
			flag = false;
		}
		if (s[s.size() - 1] == ')'&&f >= e && e - f == h) {
			owari.push_back({ {e - f,h},i });
			flag = false;
		}
		//e-f , h
		if (flag)a.push_back({ e - f,h });
	
	}
	sort(ALL(hazime));
	reverse(ALL(hazime));
	sort(ALL(owari));

	int migi = 0, hidari = 0;
	REP(i, n) {
		REP(j, vec[i].size()) {
			if (vec[i][j] == '(')migi++;
			else hidari++;
		}
	}
	if (migi != hidari) {
		cout << "No" << endl;
		return 0;
	}


	if (n == 1) {
		bool ans = true;
		if (vec[0][0] == ')')ans = false;
		if (vec[0][vec[0].size() - 1] == '(')ans = false;
		int y = 0;
		REP(i, vec[0].size()) {
			if (vec[0][i] == '(')y++;
			else y--;
			if (y < 0)ans = false;
		}
		if (ans)cout << "Yes" << endl;
		else cout << "No" << endl;
		return 0;
	}

	int ha = -1;
	P h;
	P o;
	int ow = -1;

	REP(i, hazime.size()) {
		if (ha != -1)break;
		REP(j,owari.size()) {
			if (hazime[i].second != owari[j].second) {
				ha = hazime[i].second;
				h = hazime[i].first;
				ow = owari[j].second;
				o = owari[i].first;
				break;
			}
		} 
	}
	if (ha == -1) {
		cout << "No" << endl;
		return 0;
	}

	a.clear();


	REP(i, n) {
		if (i == ha)continue;
		if (i == ow)continue;
		int e = 0, f = 0, g = 0, h = 0;
		REP(j, vec[i].size()) {
			if (vec[i][j] == '(')e++;
			else f++;
			g = max(g, e - f);
			h = min(h, e - f);
		}
		a.push_back({ e - f,h });
	}

	sort(ALL(a));
	reverse(ALL(a));

	int now = h.first;
	priority_queue<P> pq;

	REP(i, a.size()) {
		if (a[i].second + now < 0) {
			pq.push({ a[i].second,a[i].first });
		}
		else {
			now += a[i].first;
		}
		if (now < 0) {
			cout << "No" << endl;
			return 0;
		}
		while (!pq.empty()) {
			P p = pq.top();
			if (now + p.first >= 0) {
				now += p.second;
				pq.pop();
			}
			else {
				break;
			}
		}
	}
	if (pq.size() > 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}




	return 0;
}

Measured memory_bytes: 62208