// AtCoder Beginner Contest 167 - Problem F: Bracketing Sequencing (https://atcoder.jp/contests/abc167/tasks/abc167_f)
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ii = pair<ll, ll>;

string solve(int N, const vector<string>& xs)
{
    vector<int> cs;
    vector<ii> ds, es;

    int open = 0, close = 0;

    for (int i = 0; i < N; ++i)
    {
        int a = 0, b = 0;

        for (auto c : xs[i])
        {
            open += (c == '(' ? 1 : 0);
            close += (c == ')' ? 1 : 0);

            b += (c == '(' ? 1 : -1);

            if (b < 0)
            {
                a--;
                b = 0;
            }
        }

        if (b + a >= 0)
            ds.push_back(ii(-a, i));
        else
            es.push_back(ii(b, i));
    }

    if (open != close)
        return "No";

    sort(ds.begin(), ds.end());
    sort(es.begin(), es.end(), greater<ii>());

    int s = 0;

    for (auto p : ds)
    {
        auto i = p.second;

        for (auto c : xs[i])
        {
            s += (c == '(' ? 1 : -1);

            if (s < 0)
                return "No";
        }
    }

    for (auto p : es)
    {
        auto i = p.second;

        for (auto c : xs[i])
        {
            s += (c == '(' ? 1 : -1);

            if (s < 0)
                return "No";
        }
    }


    return "Yes";
}

int main()
{
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    vector<string> xs(N);

    for (int i = 0; i < N; ++i)
        cin >> xs[i];

    auto ans = solve(N, xs);

    cout << ans << '\n';

    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <fstream>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

bool cmp(pii x, pii y) {
    return 1ll * x.first * y.second < 1ll * x.second * y.first;
}

int main() {
    ios::sync_with_stdio(false);
    int n, m = 0;
    pii a[1000006] = {};
    string s;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s;
        int x = 0, y = 0;
        for (int j = 0; j < s.length(); j++) {
            if (s[j] == '(') x++;
            else x--;
            y = min(y, x);
        }
        a[i] = {-y, x};
    }
    sort(a, a + n, cmp);
    //for (int i = 0; i < n; i++) cout << a[i].first << ' ' << a[i].second << '\n';
    for (int i = 0; i < n; i++) {
        if (m < a[i].first) {
            cout << "No";
            return 0;
        }
        m += a[i].second;
    }
    if (m) cout << "No";
    else cout << "Yes";
}
