#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
template<class A, class B> ostream& operator <<(ostream& out, const pair<A, B> &p) {
    return out << "(" << p.first << ", " << p.second << ")";
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
template<class T> inline void YES(T condition) { 
    if(condition) cout << "YES" << endl;
    else cout << "NO" << endl;
}
template<class T> inline void Yes(T condition) {
    if(condition) cout << "Yes" << endl;
    else cout << "No" << endl;
}
template<class T> T gcd(T a, T b) {
    if(a && b) { return gcd(min(a, b), max(a, b) % min(a, b)); }
    else { return a; }
}
template<class T> T lcm(T a, T b){
    return a / gcd(a, b) * b;
}
long long qpow(long long a, long long b, int MOD) {
    if (b == 0) return 1;
    long long res = 1;
    while (b) {
        if (b & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        b >>= 1;
    }
    return res;
}

// const int MOD = 1e9 + 7;
// const int maxn = 2e3;
// int fac[maxn + 5];
// int invfac[maxn + 5];
// void init() {
//     fac[0] = 1;
//     for (int i = 1; i <= maxn; i++) fac[i] = 1LL * fac[i - 1] * i % MOD;
//     invfac[maxn] = (int)(qpow(fac[maxn], MOD - 2, MOD));
//     for (int i = maxn - 1; i >= 0; i--) invfac[i] = 1LL * invfac[i + 1] * (i + 1) % MOD;
// }
// int C(int n, int k) {
//     assert(0 <= k && n >= k);
//     int tmp = (int)(1LL * invfac[k] * invfac[n - k] % MOD);
//     return (int)(1LL * fac[n] * tmp % MOD);
// }

const int maxn = 1000005;
int R2L[maxn];
int L2R[maxn];
int cnt1[maxn];
int cnt2[maxn];
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<string> s(n);
    memset(R2L, 0, sizeof(R2L));
    memset(L2R, 0, sizeof(L2R));
    int summ = 0;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        stack<int> ss;
        int right = 0;
        for (auto& ch: s[i]) {
            if (ch == '(') ss.push(ch);
            else {
                if (!ss.empty()) ss.pop();
                else right++;
            }
        }
        int left = (int)ss.size();
        summ += right - left;
        if (right >= left) L2R[left] += right, cnt1[left]++;
        else R2L[right] += left, cnt2[right]++;
        // if (right >= left) vecR.emplace_back(left, right);
        // else vecL.emplace_back(left, right);
    }
    // sort(vecL.begin(), vecL.end());
    // sort(vecR.begin(), vecR.end(), [](const PII p1, const PII p2){return p1.second < p2.second;});
    if (summ != 0) {
        cout << "No" << '\n';
        return 0;
    }
    int cur = 0;  // cnt of left
    int mi = maxn;
    for (int right = 0; right < maxn; right++) {
        cur -= right * cnt2[right];
        mi = min(cur, mi);
        cur += R2L[right];
    }
    for (int left = maxn - 5; ~left; left--) {
        cur -= L2R[left];
        mi = min(cur, mi);
        cur += left * cnt1[left];
    }
    Yes(mi >= 0);
    


    return 0;
}


Measured memory_bytes: 42284