/*
AtCoderBeginnerContest167
Problem F - Bracket Sequencing /
Time Limit: 2 sec / Memory Limit: 1024 MB
Score :
600
points
*/

/*

Thought experiment:

(1) Define a "Fragment" as a sequence of some non-negative number of ) followed by some non-negative
number of (.  If we let A be the number of ')' and B be the number of '(', then we can use the ordered
pair (A, B) to describe this Fragment.  So, every Fragment can be described as an ordered pair of
non-negative integers.  Moreover, every ordered pair of non-negative integers can be used to build a Fragment.

(2) Each incoming string S_i is simply the left-to-right concatenation of 1 or more Fragments.

(3)
(3a) Any (valid) bracket sequence can be reduced to the empty string by finding a '(' followed by a ')' and
removing both of those characters, and then repeating until all characters have been removed.
(3b) If we perform this replacement pattern on any _invalid_ bracket sequence, we will never reduce to the
empty string.

(4) For two Fragments F1 and F2 that we concatenate, performing the same search for '()' pairs will reduce
this concatenated string to a Fragment F3.  We can write this as F1 + F2 = F3.  We can also replace any of
the F_i by its ordered pair and write a similar equation.
(4a) Every incoming string S_i can therefore be reduced to a single Fragment by removing '()' pairs.

(5) let F1 = (A,B) and F2 = (C,D),
    * if B<C, then F1+F2 = (A+C-B,D);
    * if B>C, then F1+F2 = (A,    D+B-C);
    * if B=C, then F1+F2 = (A,    D).

(6) F is a Right Fragment iff F = (A, 0). F is a Left Fragment iff F = (0, B). F is a Strict Left Fragment
iff F is a Left Fragment but not a Right Fragment.  F is a Strict Right Fragment iff F is a Right Fragment
but not a Left Fragment.
(6a) F1+F2 will be a Left Fragment iff F1 is a Left Fragment and B>=C.
(6b) F1+F2 will be a Right Fragment iff F2 is a Right Fragment and B<=C.
(6c) In particular, if we have a collection of Fragments, then concatenating a pair of these Fragments
will never increase the total number of Left Fragments and will never increase the total number of
Right Fragments.


*NOTE*: Was able to simplify this significantly -- see code.

(7) CLAIM: Here's the process to follow:
* First, confirm whether the total number of '(' and ')' is equal.  If not, then "No".
* Next, confirm there is at least one Strict Left Fragment and at least one Strict Right Fragment. If not,
then "No". ***EXCEPTION*** If all Fragments are Empty, then also succeed.
* Finally, reduce each incoming string to its unique Fragment. Ignore any empty Fragments, and sort the
remaining Fragments into Left, Right, and neither.
  * Concatenate all of the Left Fragments to produce a single Left Fragment of length = the obvious.
  * Concatenate all of the Right Fragments to produce a single Right Fragment of length = the obvious.
  * Sort the "neither" Fragments (A,B) into three categories:
    * Left Heavy  = those where A<B
    * Right Heavy = those where A>B
    * Balanced    = those where A=B.
  * Now sort the Left Heavy Fragments in order of increasing value of A'.
    * Going in order, concatenate each Left Heavy Fragment on the right of the Left Fragment as long as the
    result will still be a Left Fragment (A' <= B). This will cause the resulting Left Fragment to get longer
    and longer. As soon as you get to a Left Heavy Fragment with A' > B, we must stop.  This is the longest
    we can possibly make the Left Fragment.
    * After getting through as many Left Heavy Fragments as possible, get rid of any Balanced Fragments that
    have A' <= B since this leaves the Left Fragment's length unchanged ==> no harm.
    * If we get through all of the Left Heavy Fragments, then we have maximized the Left Fragment's length. Try
    concatenating with any Balanced Fragment with A' <= B.
      * If there are any Balanced Fragments left over, then return "No".  Why?  Because Left Fragment will
      never be long enough to concatenate and remain a Left Fragment.  Moreover, since total # of '(' and
      ')' is equal, and since this is also true of the total # of '(' and ') just within the Balanced
      Fragment, then the longest we can make the Right Fragment is the current length of the Right
      Fragment ==> can never get rid of any more Balanced Fragments.
      * If we _can_ get rid of all Balanced Fragments, then no harm in doing so.
  * If we end up with any Left Heavy Fragments left over, then do the same with Left <-> Right.
    * As before, get rid of as many Right Heavy Fragments as possible while keeping a Right Fragment. Then,
    get rid of any Balanced Fragments.
    * If we get through all of the Right Heavy Fragments and have any Balanced Fragments remaining, then
    return "No".
  * At this point, if we haven't already returned "No", then check whether any Balanced Fragments are left.
    * If any Balanced Fragments are left, then return "No" since neither the Left Fragment nor the Right
    Fragment will ever be any longer ==> doomed to have these Balanced Fragments forever.
  * If we reach this point, then we are out of Balanced Fragments.
    * If we are also out of both Left Heavy and Right Heavy Fragments, then return "Yes" because we just
    have a Left Fragment and a Right Fragment, and their lengths must be equal ==> Done.
  * If we still have one or more Left Heavy Fragments, then that means they each have A' > B (where
  Left Fragment is (0, B)).  Only hope to get rid of these is by concatenating on the left side of the
  Right Fragment one at a time in some order. Since each such concat shortens the Right Fragment, if there
  are currently any LHFs with B' > C (where Right Fragment is (C, 0)), then return "No" because never getting
  any better. Now let's see whether order of concatenation matters:
        * If doing both concats works, then final length of RF will be C + (A''-B'') + (A'-B') either way.
        * Consider LHF' = (A', B') and LHF'' = (A'', B'') with A' < B' <= C and A'' < B'' <= C. If OK to
        concat LHF' + (LHF'' + RF), then we must have B'' <= C and B' <= (C + A'' - B'') ==> B'+B'' <= C+A''
        * Doing the other concat requires B'+B'' <= C+A' as the only difference.
        * Therefore, if only one order works, then it will be the one that maximizes RHS ==>
            if A'>A'', do the LHF' + RF first; otherwise, do LHF'' + RF first.
    * HENCE, if there is an order of concatenation that works, it will continue to work as long as you do swaps
      that cause higher A' values to get concatenated first (required inequality is "even more" satisfied).
  * So, try sorting the remaining LHFs in decreasing order of A'.  Concatenate on the left of RF in that order
  until either finish (and still have a Right Fragment) or have some leftover LHFs.
    * Leftover LHFs ==> return "No".
  * Repeat the process with the RHFs, concatenating on right side of the LF in order of decreasing B'.
    * Leftover RHFs ==> return "No".
  [NOTE that this last step really is needed. Example that could still lead to failure is three fragments:
        (0,2), (4,3), (1,0)
        - no BFs or LHFs, but there's no way to get rid of that RHF without losing the LF or the RF
  * Otherwise, LHFs and RHFs are gone, as are the Balanced Fragments ==> just LF and RF ==> return "Yes".

*/

#include <iostream>
#include <vector>
#include <algorithm>

/* For better enum implementation, going with suggestion at

http://gamesfromwithin.com/stupid-c-tricks-2-better-enums

Basic idea there is to make the enum typename Enum but put it inside a namespace reflective
of what the enum is for. I'm throwing helper functions, etc., into this same namespace to
somewhat mimic what I would do in java.
*/
namespace FragmentType
{
    enum Enum { Empty = 0, LeftHeavy, RightHeavy };
    const int NumTypes = 6;
    Enum AllTypes[NumTypes] = { Empty, LeftHeavy, RightHeavy };
    std::string AllTypeNames[NumTypes] = { "Empty", "LeftHeavy", "RightHeavy" };

    std::string TypeName(Enum e)
    {
        for (int i=0; i<NumTypes; i++) { if (e == AllTypes[i]) { return AllTypeNames[i]; } }
        std::cerr << "Don't know how to convert Enum value " << e << " to string.\n";
        throw 1;
    }
    Enum Type(int a, int b)
    {
        if (a == 0 && b==0)
        {
            return FragmentType::Empty;
        }
        return (a<=b)?FragmentType::LeftHeavy:FragmentType::RightHeavy;
    }
}


class Fragment;
std::vector< std::vector<Fragment*> > fragmentListForType;

void initFragmentLists()
{
    for (int i=0; i<FragmentType::NumTypes; i++) { fragmentListForType.push_back(std::vector<Fragment*>()); }
}

class Fragment
{
public:
    Fragment(std::string s)
    {
        _A = 0;
        _B = 0;
        int L = s.length();
        int pos = 0;
        while (pos<L)
        {
            Fragment *curr = NextFrag(s, pos);
            this->RightAppend(curr);
            pos += (curr->_A + curr->_B);
        }
        fragmentListForType[Type()].push_back(this);
//show("constructed from string '" + s + "'");
    }

/*
    void show(std::string prefix)
    {
        std::cerr << prefix << ": [";
        std::cerr << "A: " << this->_A << "; B: " << this->_B << "; FragmentType: " <<
                FragmentType::TypeName(this->Type()) << "].\n";
    }
*/

    int A() { return this->_A; }
    int B() { return this->_B; }
    FragmentType::Enum Type()
    {
        return FragmentType::Type(_A, _B);
    }

    void RightAppend(Fragment *that)
    {
        if (this->_B >= that->_A)
        {
            this->_B += (that->_B - that->_A);
        }
        else
        {
            this->_A += (that->_A - this->_B);
            this->_B = that->_B;
        }
    }

//* Now sort the Left Heavy Fragments in order of increasing value of A'.
    bool Compare(Fragment *that)
    {
        if (this->Type() != that->Type())
        {
            std::cerr << "Can't compare this Fragment of type " << FragmentType::TypeName(this->Type()) <<
                " with that Fragment of type " << FragmentType::TypeName(that->Type()) << ".\n";
            throw 3;
        }

        if (Type() == FragmentType::LeftHeavy)
        {
            /*
            if (this->_A == that->_A) { return that->_B > this->_B; }
            else return that->_A > this->_A;
            */
            return that->_A > this->_A;
        }
        if (Type() == FragmentType::RightHeavy)
        {
            /*
            if (this->_B == that->_B) { return that->_A > this->_A; }
            else return that->_B > this->_B;
            */
            return that->_B < this->_B;
        }

        std::cerr << "Can't compare Fragments of type " << FragmentType::TypeName(this->Type()) << ".\n";
        throw 4;
    }
private:
    int _A, _B;

    Fragment(int a, int b) { _A=a; _B=b; }

    Fragment *NextFrag(std::string s, int pos)
    {
        int a = 0, b = 0;
        int L = s.length();
        while (pos < L && s[pos]==')')
        {
            pos++;
            a++;
        }
        while (pos < L && s[pos]=='(')
        {
            pos++;
            b++;
        }
        return new Fragment(a, b);
    }
};

bool Compare(Fragment* f1, Fragment* f2)
{
    return f1->Compare(f2);
}


std::vector<Fragment*> GetSortedListForType(FragmentType::Enum e)
{
    std::vector<Fragment*> fragments = fragmentListForType[e];
    if (fragments.size() > 0)
    {
        std::sort(fragments.begin(), fragments.end(), Compare);
    }
    return fragments;
}

/*
void ShowFragmentList(std::string prefix, std::vector<Fragment*> fragments)
{
    return;
    if (fragments.size() == 0) return;

    std::cerr << prefix << "\n";
    for (int i=0; i<fragments.size(); i++)
    {
        fragments[i]->show(std::to_string(i));
    }
}
*/

int main()
{
    initFragmentLists();

    int N;
    std::cin >> N;
    std::vector<Fragment*> F;
    int totA = 0, totB = 0;
    for (int i=0; i<N; i++)
    {
        std::string s;
        std::cin >> s;
        Fragment *f = new Fragment(s);
        totA += f->A();
        totB += f->B();
        F.push_back(f);
    }

    std::vector<Fragment*> LHFs = GetSortedListForType(FragmentType::LeftHeavy);
    std::vector<Fragment*> RHFs = GetSortedListForType(FragmentType::RightHeavy);

/*
    ShowFragmentList("LHFs", LHFs);
    ShowFragmentList("RHFs", RHFs);
*/

    bool success;
    if (LHFs.size()>0)
    {
        Fragment* LHF = LHFs[0];
        for (int i=1; i<LHFs.size(); i++)
        {
            LHF->RightAppend(LHFs[i]);
        }
        for (int i=0; i<RHFs.size(); i++)
        {
            LHF->RightAppend(RHFs[i]);
        }
        success = (LHF->Type() == FragmentType::Empty);
    }
    else
    {
        success = (RHFs.size()==0);
    }
    std::cout << (success?"Yes\n":"No\n");
}


Measured memory_bytes: 89136