		/*
		source:
		*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(n) for(int i=0;i<n;i++)
#define rrep(n) for(int i=n-1;i>=0;i--)
#define mod 1000000007
typedef vector<int> vi; 
typedef pair<int, int> pi; 
#define F first 
#define S second 
#define PB push_back
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t=1;
	cin>>t;
	while(t--)
	{
	string s;
	cin>>s;
	ll num=0;
	ll n=s.size();
	rep(s.size())
	{
		if(s[i]=='?')num++;
	}
	if(s[0]==')')cout<<"NO";
	else if(s[n-1]=='(')cout<<"NO";
	else if(num%2!=0)cout<<"NO";
	else cout<<"YES";

	cout<<"\n";
	}
	return 0;
}