# n 个游戏的解 n = int(input()) answer = [] for i in range(n): math = input() math = math.replace('x', '*') math = math.replace('/', '//') if eval(math) == 24: answer.append('Yes') else : answer.append('No') for i in range (n): print(answer[i])