#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

const int INF = -1e9;

struct segment_tree{
	vector<pair<int, int>> tree;
	vector<int> pos;
	int n;
	segment_tree() {}

	void build(int v, int tl, int tr, const vector<int> & a) {
		if (tl == tr - 1) {
			tree[v] = {a[tl], -tl};
			pos[tl] = v;
			return;
		}
		int tm = (tl + tr) / 2;
		build(v * 2, tl, tm, a);
		build(v * 2 + 1, tm, tr, a);
		tree[v] = max(tree[v * 2], tree[v * 2 + 1]);
	}

	segment_tree(const vector<int> & a) {
		n = a.size();
		tree.assign(4 * n, make_pair(INF, INF));
		pos.resize(n);
		build(1, 0, n, a);
	}
	void upd(int v, int val) {
		v = pos[v];
		tree[v].first = val;
		v /= 2;
		while (v) {
			tree[v] = max(tree[v * 2], tree[v * 2 + 1]);
			v /= 2;
		}
	}

	pair<int, int> get(int v, int tl, int tr, int l, int r) {
		if (tl >= r || tr <= l) return {INF, INF};
		if (tl >= l && tr <= r) return tree[v];
		int tm = (tl + tr) / 2;
		return max(get(v * 2, tl, tm, l, r), get(v * 2 + 1, tm, tr, l, r)); 
	}

	int get(int l, int r) {
		return -get(1, 0, n, l, r + 1).second;
		/*int ans = l;
		for (int i = l; i <= r; i++) {
			if (tree[i] > tree[ans]) {
				ans = i;
			}
		}
		return ans;*/
	}
};

pair<int, int> read_string() {
	string s;
	cin >> s;
	int bal = 0;
	int min_bal = 0;
	for (auto i : s) {
		if (i == '(') {
			bal++;
		} else {
			bal--;
		}
		chkmin(min_bal, bal);
	}
	return {min_bal, bal};
}

int n;
vector<pair<int,int>> a;

void read() {
	cin >> n;
	a.resize(n);
	for (auto &i : a) {
		i = read_string();
	}
}	

void no() {
	cout << "No\n";
	exit(0);
}

void check() {
	int bal = 0;
	for (auto i : a) {
		if (bal + i.first < 0) return;
		bal += i.second;
	}
	if (bal != 0) return;
	cout << "Yes\n";
	exit(0);
}

int sign(int x) {
	if (x >= 0) return 1;
	return -1;
}

void kekos() {
	/*cerr << "a = " << endl;
	for (auto i : a) {
		cerr << i.first << " " << i.second << endl;
	}
	cerr << endl;*/
	sort(all(a), [&] (pair<int, int> i, pair<int, int> j) {
		if (sign(i.second) != sign(j.second)) return sign(i.second) > sign(j.second);
		if (sign(i.second) >= 0) return i.first > j.first;
		return i.first - i.second < j.first - j.second;
	});
	check();
	cout << "No\n";
	exit(0);
}

void run() {
	kekos();
	int bal = 0;
	sort(all(a));
	vector<bool> used(n, false);
	vector<int> have;
	for (auto i : a) {
		have.push_back(i.second);
	}
	/*cout << "a = " << endl;
	for (auto i : a) {
		cout << i.first << " " << i.second << endl;
	}*/
	segment_tree tree(have);
	for (int i = 0; i < n; i++) {
		int pos = lower_bound(all(a), make_pair(-bal, INF)) - a.begin();
		//cout << "pos = " << pos << " bal = " << bal << " ";
		if (pos == n) no();
		int fans = tree.get(pos, n - 1);
		//cout << "fans = " << fans << endl;
		if (used[fans]) no();
		bal += have[fans];
		used[fans] = true;
		tree.upd(fans, INF);
	}
	if (bal != 0) no();
}

void write() {
	cout << "Yes\n";
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	read();
	run();
	write();
	return 0;
}


/*

9
()
)
))(
(
)(
)()
)))(
)(((
((()



*/

Measured memory_bytes: 11068