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

int main()
{
	int test;
	cin >> test;
	while (test--) {
		string s;
		cin >> s;
		int c = 0;
		for (auto x : s)
			c += x == '?';
		if (c % 2 == 0 && s[0] != ')' && s[s.size() - 1] != '(')
			cout << "YES\n";
		else
			cout << "NO\n";
	}
}

