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

signed main()
{
    int tt;
    cin >> tt;
    while (tt--)
    {
        string ip;
        cin>>ip;
        if((ip[0]=='('||ip[0]=='?')&&(ip[ip.length()-1]==')'||ip[ip.length()-1]=='?')&&(ip.length()%2==0)){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
}