#include<functional>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

using P = pair<int, int>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<string> S(N);
    for (auto& s : S) {
        cin >> s;
    }
    vector<P> pos, neg;
    for (auto& s : S) {
        string now;
        for (auto& c : s) {
            if (now.empty()) {
                now += c;
            } else {
                if (now.back() == '(' && c == ')') {
                    now.pop_back();
                } else {
                    now += c;
                }
            }
        }
        int A = 0, B = 0;
        for (auto& c : now) {
            if (c == ')') {
                ++A;
            } else {
                ++B;
            }
        }
        if (B - A >= 0) {
            pos.emplace_back(A, B);
        } else {
            neg.emplace_back(A, B);
        }
    }
    sort(all(pos), [](P a, P b) {
        return a.first < b.first;
    });
    int cumsum = 0;
    for (auto& p : pos) {
        cumsum -= p.first;
        if (cumsum < 0) {
            cout << "No" << endl;
            return 0;
        }
        cumsum += p.second;
    }
    sort(all(neg), [](P a, P b) {
        return a.second > b.second;
    });
    for (auto& p : neg) {
        cumsum -= p.first;
        if (cumsum < 0) {
            cout << "No" << endl;
            return 0;
        }
        cumsum += p.second;
    }
    if (cumsum) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back

#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)

const int mxn = 1e6 + 5;
int n;
char s[mxn];
int bg[mxn], ln[mxn];
int a[mxn], b[mxn];
int id[mxn];

bool comp(int x, int y) {
	return min(-a[x], -a[x] + b[x] - a[y]) > min(-a[y], -a[y] + b[y] - a[x]);
}

void NO() {
	puts("No");
	exit(0);
}

int main() {
	scanf("%d", &n);
	rep(i, n) {
		scanf("%s", s + bg[i]);
		ln[i] = strlen(s + bg[i]);
		rep(j, ln[i]) {
			if (s[bg[i] + j] == '(') {
				++ b[i];
			} else {
				if (b[i]) -- b[i];
				else ++ a[i];
			}
		}
		bg[i + 1] = bg[i] + ln[i];
		id[i] = i;
	}
	sort(id, id + n, comp);
	int A = 0;
	rep(xx, n) {
		int i = id[xx];
		A -= a[i];
		if (A < 0) NO();
		A += b[i];
	}
	if (A != 0) NO();
	puts("Yes");
	return 0;
}
