#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
    ll t;cin>>t;
    while(t--)
    {
      string s;cin>>s;int f=0,g=0;bool flag=false;ll cnt=0;
      if(s[0]==')' || s[s.length()-1]=='(')
      flag=true;
      for(int i=0;i<s.length();i++)
      {
      	if(s[i]=='?')
      	cnt++;
	  }
      if(cnt%2!=0 || flag)
      cout<<"NO"<<"\n";
      else
      {
          cout<<"YES"<<"\n";
      }
      
    }
    return 0;
}
