#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define akash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define miel min_element
#define mael max_element
int32_t main()
{		
	akash;
        int t;
        cin>>t;
        while(t--)
        {
                string s;
                int i,o=0,c=0;
                cin>>s;
                int n=s.length();
                if(n%2==1)
                {cout<<"NO\n"; continue;}
                if(s[0]==')' || s[n-1]=='(')
                {cout<<"NO\n"; continue;}
                for(i=0;i<n;i++)
                {
                        if(s[i]=='(')
                        o++;
                        else if(s[i]==')')
                        c++;
                }
                if(o>(n/2) || c>(n/2))
                {cout<<"NO\n"; continue;}
                cout<<"YES\n";
        }
}