#include<bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin>>t;
	string str;
	while(t--){
		cin>>str;
		int n=str.size();
		if(n%2!=0){cout<<"NO"<<endl;}
		else{
			if(str[0]=='('&&(str[n-1]==')'||str[n-1]=='?'))cout<<"YES"<<endl;
			else if(str[0]=='?'&&(str[n-1]==')'||str[n-1]=='?'))cout<<"YES"<<endl;
			else cout<<"NO"<<endl;
		}
	}
	
	return 0;
} 