a整除b是b % a == 0
if __name__ == '__main__':
n = int(input())
res = []
inputs = input().split(" ")
for i in inputs:
ns = []
isR = False
for j in range(1,int(i) + 1):
if int(i) % j == 0:
ns.append(j)
for j in range(len(ns)):
if isR:
break
for a in range(j + 1, len(ns)):
if isR:
break
for b in range(a + 1, len(ns)):
if isR:
break
for c in range(b + 1, len(ns)):
s = ns[j] + ns[a] + ns[b] + ns[c]
if isR:
break
if s % int(i) == 0:
res.append("Yes")
isR = True
break
if not isR:
res.append("No")
for i in res:
print(i)