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

int main(){
    int t;
    cin>>t;
    while(t--){
       string s;
       cin>>s;
       int count_q = 0;
       if(s[0]==')'){
           cout<<"NO"<<endl;
           continue;
       }
       if(s[s.length()-1] == '('){
           cout<<"NO"<<endl;
           continue;
       }
       for(int i = 0;i<s.length();i++){
          if(s[i]=='?'){
              count_q++;
          }
       }
       if(count_q%2!=0){
           cout<<"NO"<<endl;
           continue;
       }
       cout<<"YES"<<endl;
    }

    return 0;
}
