Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken.

CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one — 7 chunks. Ivan wants to eat exactly x chunks. Now he wonders whether he can buy exactly this amount of chicken.

Formally, Ivan wants to know if he can choose two non-negative integers a and b in such a way that a small portions and b large ones contain exactly x chunks.

Help Ivan to answer this question for several values of x!


-----Input-----

The first line contains one integer n (1 ≤ n ≤ 100) — the number of testcases.

The i-th of the following n lines contains one integer x_{i} (1 ≤ x_{i} ≤ 100) — the number of chicken chunks Ivan wants to eat.


-----Output-----

Print n lines, in i-th line output YES if Ivan can buy exactly x_{i} chunks. Otherwise, print NO.


-----Example-----
Input
2
6
5

Output
YES
NO



-----Note-----

In the first example Ivan can buy two small portions.

In the second example Ivan cannot buy exactly 5 chunks, since one small portion is not enough, but two small portions or one large is too much.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
for i in range(n):
    x=int(input())
    f=0
    for a in range(100):
        for b in range(100):
            if 3*a+7*b==x:
                f=1
    if f==1:
        print("YES")
    else:
        print("NO")

t = int(input())

for _ in range(t):
    k = int(input())

    if k in [1,2,4,5,8,11]:
        print('NO')
    else:
        print('YES')


for i in range(int(input())):
  x=int(input())
  print('YES'if any((3*i+7*j==x for i in range(100) for j in range(100)))else'NO')


n=int(input())
for N in range(n):
    x=int(input())
    f=0
    for i in range(35):
        for j in range(35):
            if 3*i + 7*j == x:
                f=1
                break
    if f:
        print('YES')
    else:
        print('NO')


n = int(input())
d = [0] * 110
d[0] = 1
for i in range(1, 105):
    if (i - 3 >= 0):
        d[i] |= d[i - 3]
    if (i - 7 >= 0):
        d[i] |= d[i - 7]
for i in range(n):
    m = int(input())
    if (d[m]):
        print('YES')
    else:
        print('NO')


n = int(input())
for _ in range(n):
	x = int(input())
	if x in [1, 2,4,5,8,11]:
		print('NO')
	else:
		print('YES')

n = int(input())

for i in range(n):
    x = int(input())
    possible = False
    for s in range(x // 3 + 2):
        for l in range(x // 7 + 2):
            if s * 3 + l * 7 == x:
                possible = True
    print("YES" if possible else "NO")




n = int(input())

for _ in range(n):
    x = int(input())
    found = False
    a = 0
    while a * 7 <= x:
        if (x - a * 7) % 3 == 0:
            found = True;
            break
        a += 1
    if found:
        print("YES")
    else:
        print("NO")


n = int(input())
for i in range(n):
	t = int(input())
	for j in range(7):
		if j * 3 <= t and (t - j * 3) % 7 == 0:
			print('YES')
			break
	else:
		print('NO')

def ii():
    return int(input())
def mi():
    return list(map(int, input().split()))
def li():
    return list(mi())

for i in range(ii()):
    x = ii()
    ok = 0
    while x >= 0:
        if x % 3 == 0:
            ok = 1
            break
        x -= 7
    print('YES' if ok else 'NO')
    


t=int(input())
#t=1
for i in range(t):
    n=int(input())
    f=0
    for i in range(0,101):
        for j in range(0,101):
            if i*3+j*7==n:
                print("YES")
                f=1
                break
        if f==1:
            break
    if f==0:
        print("NO")

n = int(input())
setA = {1, 2, 4, 5, 8, 11}
for i in range(n):
    s = int(input())
    if s in setA:
        print('NO')
    else:
        print('YES')    

#map(int, input().split())
def check(a):
    if a % 3 == 0 or a % 7 == 0:
        return True
    if a in [1, 2, 4, 5, 8, 11]:
        return False
    return True
n = int(input())
for i in range(n):
    x = int(input())
    if check(x):
        print('YES')
    else:
        print('NO')


n = int(input())
a = []
for i in range(101):
	for j in range(101):
		a.insert(0, i * 3 + j * 7)

for i in range(n):
	x = int(input())
	print('YES' if x in a else 'NO')

n = int(input())
for i in range(n):
    x = int(input())
    for a in range(x // 3 + 1):
        if (x - a * 3) % 7 == 0:
            print('YES')
            break
    else:
        print('NO')


def test():
    x = int(input())
    for b in range(20):
        t = x - 7 * b
        if t >= 0 and t % 3 == 0:
            print('YES')
            return
    print('NO')

n = int(input())

for _ in range(n):
    test()


def __starting_point():
    tc = int(input().strip())
    for _ in range(tc):
        x = int(input().strip())
        found = False
        for a in range(x):
            for b in range(x):
                if (3 * a) + (7 * b) == x:
                    found = True
                    break
            if found:
                break
        print("YES" if found else "NO")

__starting_point()

def check(x):
	if x < 3:
		return False
	if x == 3:
		return True
	if x % 7 == 0:
		return True
	if x % 3 == 0:
		return True
	else:
		return check(x - 3)				

n = int(input())
for _ in range(n):
	x = int(input())
	if check(x):
		print("YES")
	else:
		print("NO")	

n = int(input())

aa = []
for i in range(n):
    aa.append(int(input()))
for a in aa:

    flag = True
    for t in range(35):
        if (a - (t*3)) % 7 == 0 and  a - (t*3) >= 0:
            print("YES")
            flag = False
            break
    if flag:
        print("NO")

read=lambda: list(map(int,input().split()))
n=int(input())
for i in range(n):
    x=int(input())
    if x not in [1,2,4,5,8,11]:
        print('YES')
    else:
        print('NO')



n = int(input())
for _ in range(n):
    x = int(input())
    if x in [1, 2, 4, 5, 8, 11]:
        print('NO')
    else:
        print('YES')



def main(x):
    b = x // 7
    a = 0
    while b * 7 + a * 3 != x:
        if b * 7 + a * 3 > x:
            b -= 1
        else:
            a += 1
        if b < 0:
            return "NO"
    return "YES"

def __starting_point():
    n = int(input())
    for i in range(n):
        print(main(int(input())))
__starting_point()

n = int(input())
v = {3, 7}
ps = 0
while len(v) != ps:
    nv = {i for i in v}
    for a in v:
        if a + 3 <= 100:
            nv.add(a+3)
        if a + 7 <= 100:
            nv.add(a+7)
    ps = len(v)
    v = nv
for i in range(n):
    x = int(input())
    if x in v:
        print('YES')
    else:
        print('NO')