Bob is playing with $6$-sided dice. A net of such standard cube is shown below.

[Image]

He has an unlimited supply of these dice and wants to build a tower by stacking multiple dice on top of each other, while choosing the orientation of each dice. Then he counts the number of visible pips on the faces of the dice.

For example, the number of visible pips on the tower below is $29$ — the number visible on the top is $1$, from the south $5$ and $3$, from the west $4$ and $2$, from the north $2$ and $4$ and from the east $3$ and $5$.

[Image]

The one at the bottom and the two sixes by which the dice are touching are not visible, so they are not counted towards total.

Bob also has $t$ favourite integers $x_i$, and for every such integer his goal is to build such a tower that the number of visible pips is exactly $x_i$. For each of Bob's favourite integers determine whether it is possible to build a tower that has exactly that many visible pips.


-----Input-----

The first line contains a single integer $t$ ($1 \leq t \leq 1000$) — the number of favourite integers of Bob. 

The second line contains $t$ space-separated integers $x_i$ ($1 \leq x_i \leq 10^{18}$) — Bob's favourite integers.


-----Output-----

For each of Bob's favourite integers, output "YES" if it is possible to build the tower, or "NO" otherwise (quotes for clarity).


-----Example-----
Input
4
29 34 19 38

Output
YES
YES
YES
NO



-----Note-----

The first example is mentioned in the problem statement.

In the second example, one can build the tower by flipping the top dice from the previous tower.

In the third example, one can use a single die that has $5$ on top.

The fourth example is impossible.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Constructive algorithms


Solutions:
n = int(input())
l = list(map(int, input().split(' ')))
for i in range(n):
	if l[i] < 15:
		print('NO')
	elif l[i] % 7 == 0:
		print('NO')
	else:
		a = l[i] // 7
		if a % 2 == 0:
			print('YES')
		else:
			print('NO')


n = int(input())
l = list(map(int, input().split()))
for e in l:
	if e < 15:
		print('No')
	elif e % 14 > 0 and e % 14 < 7:
		print('Yes')
	else:
		print('No')


a = int(input())
n = [*map(int, input().split())]
for i in range(0, len(n)):
	temp = n[i]
	n[i] = n[i] - 20
	count = 1
	if n[i] >= 0:
		a = n[i] // 14
		if n[i] - 14 * a == 0:
			print('Yes')
		else:
			count = count + a + 1
			ans = temp - 14 * count
			if ans >= 1 and ans <= 6:
				print('Yes')
			else:
				print('No')
	elif n[i] < 0:
		ans = temp - 14
		if ans >= 1 and ans <= 6:
			print('Yes')
		else:
			print('No')


input()
a = list(map(int, input().split()))
top = [15, 16, 17, 18, 19, 20]
for i in a:
	if i < 21:
		if i in top:
			print('YES')
		else:
			print('NO')
	else:
		flag = False
		for j in top:
			if (i - j) % 14 == 0:
				print('YES')
				flag = True
				break
		if not flag:
			print('NO')


n = int(input())
l = list(map(int, input().split()))
for x1 in l:
	if x1 > 14:
		r = x1 - 15
		t = r % 14
		if t == 0 or t == 1 or t == 2 or (t == 3) or (t == 4) or (t == 5):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
x = list(map(int, input().split()))
for i in x:
	d = i // 14
	a = i % 14
	if d >= 1 and (a >= 1 and a <= 6):
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for i in a:
	q = i // 14
	r = i % 14
	if q > 0 and r > 0 and (r < 7):
		print('YES')
	else:
		print('NO')


import sys, math, queue, collections
MOD = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
ans = list(map(lambda x: x > 14 and x % 14 != 0 and (x % 14 < 7), a))
for ansi in ans:
	print('YES' if ansi else 'NO')


cases = int(input())
lst = list(map(int, input().split()))
for n in lst:
	if n < 15:
		print('NO')
	elif n % 14 in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


t = int(input())
n = list(map(int, input().split()))
for i in n:
	if i >= 15:
		modd = i % 14
		modd += 14
		if modd >= 15 and modd <= 20:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = []
	l = LI()
	for x in l:
		if 15 <= x < 21:
			ans.append('YES')
		else:
			a = []
			for i in range(15, 21):
				a.append(x - i)
			f = False
			for y in a:
				if y >= 14 and y % 14 == 0:
					f = True
					break
			if f:
				ans.append('YES')
				continue
			else:
				ans.append('NO')
	for x in ans:
		print(x)
main()


n = int(input())
x = list(map(int, input().split()))
for i in x:
	r = i % 14
	if r >= 1 and r <= 6 and (i > 14):
		print('YES')
	else:
		print('NO')


import math
n = int(input())
a = [int(i) for i in input().split()]
s = 21
for i in a:
	f = True
	for t in range(1, 7):
		if (t + i - 7) % 14 == 0 and (t + i - 7) // 14 >= 1:
			print('YES')
			f = False
			break
	if f:
		print('NO')


from sys import stdin

def iin():
	return int(stdin.readline())

def lin():
	return list(map(int, stdin.readline().split()))

def main():
	t = iin()
	a = lin()
	for i in a:
		if i < 14:
			print('NO')
			continue
		for j in range(1, 7):
			if (i - j) % 14 == 0:
				print('YES')
				break
		else:
			print('NO')
main()


n = int(input())
mas = list(map(int, input().split()))
for a in mas:
	ost = a % 14
	if a < 15:
		print('NO')
		continue
	if ost < 7 and ost != 0:
		print('YES')
	else:
		print('NO')


poss = [15, 16, 17, 18, 19, 20]
poss2 = [14]

def test(n):
	flag = False
	for a in poss:
		p = n - a
		for b in poss2:
			if p >= 0 and p % b == 0:
				print('YES')
				flag = True
				break
		if flag:
			break
	if not flag:
		print('NO')
n = int(input())
nn = list(map(int, input().split()))
for x in nn:
	test(x)


t = int(input())
xx = list(map(int, input().split()))
for x in xx:
	tt = x % 14
	dd = x // 14
	if tt >= 1 and tt <= 6 and (dd >= 1):
		print('yes')
	else:
		print('no')


t = int(input())
L = list(map(int, input().split()))
for i in L:
	if i % 14 >= 1 and i % 14 <= 6 and (i > 14):
		print('Yes')
	else:
		print('No')


q = input()
n = list(input().split())
n = [int(j) for j in n]
for a in n:
	if a <= 14:
		print('NO')
		continue
	x = a % 14
	if x <= 6 and x >= 1:
		print('YES')
	else:
		print('NO')


s = int(input())
li = list(map(int, input().split()))
for i in range(s):
	if li[i] % 14 <= 6 and li[i] > 14 and (li[i] % 14 != 0):
		print('YES')
	else:
		print('NO')


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
x = list(map(int, input().split()))
for i in x:
	if 14 < i and 0 < i % 14 < 7:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in l:
	k = i
	k = k % 14
	if k < 7 and k != 0 and (i > 14):
		print('YES')
	else:
		print('NO')


_ = int(input())
nums = list(map(int, input().split()))
for num in nums:
	if num <= 14:
		print('NO')
		continue
	if 0 < num % 14 < 7:
		print('YES')
	else:
		print('NO')


n = int(input())
val = list(map(int, input().split()))
for x in val:
	check = False
	for k in range(1, 7):
		if x - k > 0 and (x - k) % 14 == 0:
			check = True
	if check:
		print('YES')
	else:
		print('NO')


n = int(input())
L = [int(i) for i in input().split()]
for i in range(n):
	g = L[i]
	if 0 < g % 14 < 7 and g > 14:
		print('YES')
	else:
		print('NO')


n = input()
for favorite_digit in map(int, input().split(' ')):
	balance = favorite_digit % 14
	if 0 < balance < 7 and favorite_digit > 14:
		print('YES')
	else:
		print('NO')


t = int(input())
x = list(map(int, input().strip().split()))
for n in x:
	q = n // 14
	r = n % 14
	if r > 0 and r < 7 and (q > 0):
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	a = list(map(int, input().split()))
	for x in a:
		if x > 14:
			if 0 < x % 14 < 7:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
main()


t = int(input())
x = [int(i) for i in input().split()]
for i in x:
	if i < 14:
		print('NO')
	else:
		k = i - i // 14 * 14
		if k in [1, 2, 3, 4, 5, 6]:
			print('YES')
		else:
			print('NO')


l = int(input())
a = input().split()
for i in a:
	c = int(i)
	if c > 14:
		c = c % 14
		if c >= 7 or c == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


T = int(input())
res = []
q = [int(k) for k in input().split()]
for i in q:
	if i % 14 > 6 or i <= 14 or i % 14 == 0:
		res.append('NO')
	else:
		res.append('YES')
for i in res:
	print(i)


numbers = int(input())
L = [int(x) for x in input().split()]
for i in range(numbers):
	if L[i] <= 14:
		print('NO')
	elif L[i] % 14 == 0:
		print('NO')
	elif L[i] % 14 < 7:
		print('YES')
	else:
		print('NO')


i = int(input())
a = list(map(int, input().strip().split()))[:i]
b = []
for j in range(len(a)):
	if a[j] <= 14 or a[j] % 14 == 0:
		b.append(100)
	else:
		b.append(a[j] % 14)
for k in range(len(b)):
	if b[k] <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
s = list(map(int, input().split()))
a = [1, 2, 3, 4, 5, 6]
for i in s:
	if i > 14:
		if i % 14 in a:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
x = list(map(int, input().rstrip().split()))
for _ in range(len(x)):
	if x[_] < 21:
		if 21 - x[_] in [1, 2, 3, 4, 5, 6]:
			print('YES')
		else:
			print('NO')
	elif x[_] - 14 * (x[_] // 14) not in [1, 2, 3, 4, 5, 6]:
		print('NO')
	else:
		print('YES')


n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	t = a[i] // 14
	r = 14 * t + 1
	s = r + 6
	if a[i] >= r and a[i] < s and (a[i] > 14):
		print('YES')
	else:
		print('NO')


def solve(n):
	if n < 15:
		return False
	if 15 <= n <= 20:
		return True
	for i in range(15, 20 + 1):
		if (n - i) % 14 == 0:
			return True
	return False
t = int(input())
values = map(int, input().split())
for n in values:
	if solve(n):
		print('YES')
	else:
		print('NO')


def checkposs(x):
	if x < 15:
		return 0
	y = x % 14
	if y > 0 and y < 7:
		return 1
	else:
		return 0
t = int(input())
A = list(map(int, input().split()))
for x in A:
	if checkposs(x):
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for n in l:
	if n > 14 and (n % 14 >= 1 and n % 14 <= 6):
		print('YES')
	else:
		print('NO')


def play(N):
	if N <= 14:
		return 'NO'
	rest = N % 14
	if rest <= 6 and rest > 0:
		return 'YES'
	return 'NO'

def main():
	input()
	arr = list(map(int, input().split()))
	for p in arr:
		print(play(p))
main()


import sys
from heapq import heappop
from heapq import heappush
from heapq import heapify
from bisect import insort
from bisect import bisect_right
from bisect import bisect_left
from sys import stdin, stdout
from collections import defaultdict, deque
from math import log2, ceil, floor
inp = lambda : int(input())
sip = lambda : input()
mulip = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))
slst = lambda : list(sip())
arr2d = lambda x: [[int(j) for j in input().split()] for i in range(x)]
odds = lambda l: len(list(filter(lambda x: x % 2 != 0, l)))
evens = lambda l: len(list(filter(lambda x: x % 2 == 0, l)))
mod = pow(10, 9) + 7
Judge = 0
if Judge:
	sys.stdin = open('input.in', 'r')
n = inp()
l = lst()
for i in range(n):
	if l[i] > 14 and l[i] <= 20:
		print('YES')
	else:
		a = l[i] // 14
		m = l[i] % 14
		if a > 1:
			x = 14 + m
			if x > 14 and x <= 20:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	if i // 7 % 2 == 0 and i // 7 > 0 and (i % 7 > 0):
		print('YES')
	else:
		print('NO')


for _ in range(1):
	n = input()
	a = [int(i) for i in input().split()]
	for x in a:
		if x >= 15 and 1 <= x % 14 <= 6:
			print('YES')
		else:
			print('NO')


input()
for i in map(int, input().split()):
	p = i % 14
	if i > 14 and p > 0 and (p < 7):
		print('YES')
	else:
		print('NO')


a = int(input())
b = list(map(int, input().split()))
for i in range(a):
	if b[i] > 14:
		if b[i] % 14 <= 6 and b[i] % 14 > 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


def check(i):
	if 6 >= i % 14 and i % 14 >= 1 and (i / 14 >= 1):
		return True
	return False

def main():
	n = int(input())
	s = list(map(int, input().split(' ')))
	for i in s:
		if check(i) == True:
			print('YES')
		else:
			print('NO')
main()


import sys
Input = sys.stdin.readline
t = int(Input())
x = list(map(int, Input().split()))
for i in range(t):
	tmp = x[i] // 14 - 1
	x[i] -= 14 * max(0, tmp)
	if 15 <= x[i] < 21:
		print('yes')
	else:
		print('no')


n = int(input())
l = [int(i) for i in input().split()]
for i in l:
	if i % 14 in [1, 2, 3, 4, 5, 6] and i > 14:
		print('YES')
	else:
		print('NO')


nb = int(input())
ar = [int(x) for x in input().split()]
for i in ar:
	r = i % 14
	print(['NO', 'YES'][i > 14 and r > 0 and (r <= 6)])


t = int(input())
arr = list(map(int, input().split()))
for i in range(len(arr)):
	if arr[i] <= 14 or arr[i] % 14 > 6 or arr[i] % 14 == 0:
		print('NO\n')
	else:
		print('YES\n')


def color(j):
	if j > 14 and j % 14 > 0 and (j % 14 < 7):
		return 'YES'
	return 'NO'

def main():
	i = int(input())
	j = str(input()).split(' ')
	for a in j:
		print(color(int(a)))
main()


t = int(input())
l = list(map(int, input().split()))
for i in l:
	if i <= 14:
		print('NO')
		continue
	x = i % 14
	if x >= 1 and x <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
nums = list(map(int, input().split()))
head = [15, 16, 17, 18, 19, 20]
result = []
for num in nums:
	if num > 20:
		if 0 < num % 14 < 7:
			result.append('YES')
		else:
			result.append('NO')
	elif num > 14:
		result.append('YES')
	else:
		result.append('NO')
for r in result:
	print(r)


n = int(input())
a = list(map(int, input().split()))
for x in a:
	for i in range(15, 21):
		if x >= i and (x - i) % 14 == 0:
			print('YES')
			break
	else:
		print('NO')


n = int(input())
testcase = list(map(int, input().split()))
for i in testcase:
	if 1 <= i % 14 <= 6 and i > 13:
		print('YES')
	else:
		print('NO')


l = [1, 2, 3, 4, 5, 6]
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	nw = a[i]
	now = nw % 14
	if now in l and nw > 10:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	nums_str = input()
	nums = [int(num) for num in nums_str.split()]
	for num in nums:
		rem = num % 14
		if num >= 15 and rem >= 1 and (rem <= 6):
			print('YES')
		else:
			print('NO')
main()


t = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	if a[i] < 15:
		print('NO')
		continue
	a[i] %= 14
	if a[i] <= 6 and a[i] != 0:
		print('YES')
	else:
		print('NO')


t = int(input())
numbers = list(map(int, input().strip().split()))
for number in numbers:
	x = number // 14
	tmp = number - x * 14
	if x == 0:
		print('NO')
	elif tmp in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	flag = 'NO'
	if i >= 15:
		for j in range(1, 7):
			if abs(i - j) % 14 == 0:
				flag = 'YES'
				break
	print(flag)


n = int(input())

def getAns(li):
	for x in li:
		if x > 14:
			if x % 14 <= 6 and x % 14 > 0:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
getAns([int(x) for x in input().split(' ')])


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] % 14 > 0 and a[i] % 14 < 7 and (a[i] > 14):
		print('YES')
	else:
		print('NO')


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
t = mint()
for x in mints():
	if x >= 15 and x % 14 >= 1 and (x % 14 <= 6):
		print('YES')
	else:
		print('NO')


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	a = [15, 16, 17, 18, 19, 20]
	for i in range(n):
		num = arr[i]
		res = 'NO'
		for j in range(len(a)):
			if num - a[j] >= 0 and (num - a[j]) % 14 == 0:
				res = 'YES'
				break
		print(res)
t = 1
for _ in range(t):
	main()


N = int(input())
lst = [int(x) for x in input().strip().split()]
for i in range(N):
	num = lst[i]
	if num % 14 > 6 or num < 15 or (not num % 14):
		print('NO')
	else:
		print('YES')


t = int(input())
test = list(input().split())
ans = []
for i in test:
	n = int(i)
	if n - 20 < 0:
		dice = 1
	if n - 20 > 0:
		dice = (n - 21) // 14 + 2
	z = 21 - (n - 14 * (dice - 1))
	if z > 0 and z < 7:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


n = int(input())
A = list(map(int, input().split()))
for el in A:
	if el % 14 <= 6 and el % 14 != 0 and (el >= 15):
		print('YES')
	else:
		print('NO')


input()
for x in map(int, input().split()):
	print('NYOE S'[(x - 1) % 14 < 6 < x::2])


t = int(input())
lis = [20, 19, 18, 17, 16, 15]
a = list(map(int, input().split()))
for n in a:
	if n in lis:
		print('YES')
	elif n < 15:
		print('NO')
	else:
		k = n // 14
		ok = False
		num = (k - 1) * 14
		for i in range(len(lis)):
			if num + lis[i] == n:
				ok = True
				break
		if ok == True:
			print('YES')
		else:
			print('NO')


n = int(input())
a = list(map(int, input().split()))
b = [1, 2, 3, 4, 5, 6]
for i in a:
	t = i
	m = t % 14
	if m in b and t > 14:
		print('YES')
	else:
		print('NO')


n = int(input())
for test in list(map(int, input().split())):
	if test < 14:
		print('NO')
		continue
	test %= 14
	print('YES' if 0 < test < 7 else 'NO')


t = int(input())
l1 = list(map(int, input().split()))
for i in range(t):
	x = l1[i]
	b = 0
	for j in range(1, 7):
		if (x - j) % 14 == 0 and x - j > 0:
			b = 1
	if b:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in range(t):
	if l[i] > 14 and l[i] % 14 <= 6 and (l[i] % 14 != 0):
		print('YES')
	else:
		print('NO')


n = int(input())
x = list(map(int, input().split()))
for i in x:
	if i <= 14:
		print('NO')
	elif i % 14 > 6:
		print('NO')
	elif i % 14 == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
a = list(map(int, input().split()))
for j in range(n):
	x = a[j]
	if x < 15:
		print('NO')
		continue
	ans = 'NO'
	for i in range(15, 21):
		if (x - i) % 14 == 0:
			ans = 'YES'
			break
	print(ans)


import math as m
t = int(input())
lst = list(map(int, input().strip().split()))[:t]
for i in lst:
	o = i % 14
	O = m.floor(i / 14)
	print('YES' if O >= 1 and o >= 1 and (o <= 6) else 'NO')


t = int(input())
s = list(map(int, input().split()))
for i in s:
	if i % 7 != 0 and i // 7 % 2 == 0 and (i // 7 != 0):
		print('YES')
	else:
		print('NO')


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
write = sys.stdout.write

def exit(*arg):
	print(*arg)
	sys.exit()

def main():
	t = int(readline())
	a = list(map(int, readline().split()))
	for _ in range(t):
		n = a[_]
		if 1 <= n % 14 <= 6 and n >= 15:
			print('YES')
		else:
			print('NO')
	return
main()


import time
import bisect

def is_good(f):
	g = f[0]
	return all((i == g for i in f))
LOCAL = False
start_time = None
if LOCAL:
	start_time = time.time()
n = int(input())
a = list(map(lambda x: int(x), input().split(' ')))
for z in a:
	can = False
	if z < 15:
		print('NO')
		continue
	for x in range(1, 7):
		if (z - x) % 14 == 0:
			can = True
	print('YES' if can else 'NO')
if LOCAL:
	print('--- %s seconds ---' % (time.time() - start_time))


n = int(input())
for x in map(int, input().split()):
	d = x % 14
	print('YES' if 15 <= x and 1 <= d <= 6 else 'NO')


t = int(input())
items = list(map(int, input().split()))
for item in items:
	if item < 15:
		print('NO')
	else:
		item = item % 14
		if item < 1 or item > 6:
			print('NO')
		else:
			print('YES')


t = int(input())
x = list(map(lambda x: int(x), input().split()))
for i in x:
	if i < 15:
		print('NO')
		continue
	r = i % 14
	if r == 0 or r > 6:
		print('NO')
	else:
		print('YES')


n = int(input())
B = [1, 2, 3, 4, 5, 6]
A = list(map(int, input().split()))
for i in range(n):
	if A[i] % 14 in B and A[i] > 14:
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for i in a:
	if i > 14 and i % 14 <= 6 and i % 14:
		print('YES')
	else:
		print('NO')


n = int(input())
m = list(map(int, input().split()))
for x in m:
	if x > 14 and x % 14 <= 6 and (x % 14 != 0):
		print('YES')
	else:
		print('NO')


import math
n = int(input())
l = list(map(int, input().split()))
for k in l:
	if k - 20 <= 0:
		if k >= 15 and k <= 20:
			print('YES')
		else:
			print('NO')
	else:
		c = k % 14
		if c >= 1 and c <= 6:
			print('YES')
		else:
			print('NO')


a = input()
k = input().split()
val = [15, 16, 17, 18, 19, 20]
for i in k:
	flag = False
	if int(i) > 14:
		for j in val:
			if (int(i) - j) % 14 == 0:
				flag = True
				break
	if flag:
		print('YES')
	else:
		print('NO')


n = int(input())
delta = [int(x) for x in input().split()]
for i in range(n):
	num = delta[i]
	x = num % 14
	if (x >= 1 and x <= 6) and num >= 15:
		print('YES')
	else:
		print('NO')


import sys
import collections
import heapq
import math
import bisect
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rstr():
	return input().strip()

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = rint()
x = rintas()
for i in x:
	if i < 15:
		print('NO')
	elif i >= 15 and i < 21:
		print('YES')
	else:
		d = i // 14
		d2 = i - (d - 1) * 14
		if d2 >= 15 and d2 < 21:
			print('YES')
		else:
			print('NO')


import math
import collections
import sys

def inpu():
	return input().split(' ')

def inti(a):
	for i in range(len(a)):
		a[i] = int(a[i])
	return a

def inp():
	a = inpu()
	a = inti(a)
	return a
t = int(input())
x = input().split()
s = []
for i in x:
	if int(i) < 15:
		s.append('NO')
	else:
		d = int(i) % 14
		if 0 < d <= 6:
			s.append('YES')
		else:
			s.append('NO')
for i in s:
	print(i)


def solve():
	n = int(input())
	x = list(map(int, input().split()))
	for val in x:
		if val >= 14 and val % 14 < 7 and (val % 14 > 0):
			print('YES')
		else:
			print('NO')
solve()


t = int(input())
a = list(map(int, input().split()))
for i in a:
	if i > 0 and i <= 6:
		print('NO')
		continue
	val = i % 7
	val1 = i // 7
	if val == 0 or val1 % 2 != 0:
		print('NO')
	elif val > 0 and val <= 6 and (val1 % 2 == 0):
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for v in a:
	if v % 14 == 0 or v % 14 > 6 or v < 15:
		print('NO')
	else:
		print('YES')


import sys
import collections
from collections import Counter
import itertools
import math
import timeit
input = sys.stdin.readline

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
d = li()
res = []
for a in d:
	f = 1
	for i in range(1, 7):
		if a > 13 and (a - i) % 14 == 0:
			res.append('YES')
			f = 0
			break
	if f:
		res.append('NO')
prr(res, '\n')


import sys
input = sys.stdin.buffer.readline
t = int(input())
xx = [int(y) for y in input().split()]
for x in xx:
	ok = False
	if x > 14:
		for i in range(1, 7):
			if (x - 7 + i) % 14 == 0:
				ok = True
				break
	if ok:
		print('YES')
	else:
		print('NO')


t = int(input())
x = [int(i) for i in input().split()]
for i in x:
	i = i - 15
	if i >= 0:
		if i % 14 <= 5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from math import ceil
n = int(input())
X = list(map(int, input().split()))
for x in X:
	res = 'NO'
	l = ceil((x - 20) / 14)
	for k in range(l + 6, l - 6, -1):
		if k >= 0 and 15 + 14 * k <= x <= 20 + 14 * k:
			res = 'YES'
			break
	print(res)


t = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
	qw = pow(l[i], 1, 14)
	if qw < 7 and qw > 0 and (l[i] > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
inp = list(map(int, input().split()))
for i in range(n):
	if inp[i] > 14:
		r = inp[i] % 14
		if r and r < 7:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


nums = [20, 15, 19, 16, 18, 17]

def solve(n):
	for i in range(6):
		tmp = n
		tmp -= nums[i]
		if tmp % 14 == 0 and tmp >= 0:
			return 'YES'
	return 'NO'
n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	print(solve(arr[i]))


n = int(input())
ar = list(map(int, input().split()))
for x in ar:
	if x == 0 or (((x - 1) % 14 == 0 or (x - 2) % 14 == 0 or (x - 3) % 14 == 0 or ((x - 4) % 14 == 0) or ((x - 5) % 14 == 0) or ((x - 6) % 14 == 0)) and x > 14):
		print('YES')
	else:
		print('NO')


from collections import defaultdict
import math
t = int(input())
a = list(map(int, input().split()))
for i in a:
	x = i // 7
	if x == 0:
		print('NO')
	elif x % 2 == 0 and i % 7 != 0:
		print('YES')
	else:
		print('NO')


N = int(input())
L = map(int, input().split())
for i in L:
	if i % 14 <= 6 and i >= 15 and (i % 14 != 0):
		print('YES')
	else:
		print('NO')


n = int(input())
s = input()
v = []
v = s.split()

def solve(x):
	y = x
	y -= 20
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	y = x
	y -= 19
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	y = x
	y -= 18
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	y = x
	y -= 17
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	y = x
	y -= 16
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	y = x
	y -= 15
	if y == 0:
		return 'YES'
	if y > 0:
		if y % 14 == 0:
			return 'YES'
	return 'NO'
for i in range(n):
	x = int(v[i])
	print(solve(x))


n = int(input())
a = [int(i) for i in input().split()]
for i in range(n):
	if (a[i] % 14 == 1 or a[i] % 14 == 2 or a[i] % 14 == 3 or (a[i] % 14 == 4) or (a[i] % 14 == 5) or (a[i] % 14 == 6)) and a[i] > 14:
		print('YES')
	else:
		print('NO')


t = int(input())
arr = input().split()
ans = []
for i in arr:
	if int(i) < 15 or int(i) % 14 == 0:
		ans.append('NO')
		continue
	if int(i) % 14 <= 6:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_str():
	return list(sys.stdin.readline().split())
N = inp()
aa = inpl()
S = 1 + 2 + 3 + 4 + 5 + 6
for a in aa:
	if a <= 14:
		print('NO')
	elif 1 <= a % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
li = list(map(int, input().split()))
for i in li:
	if i <= 14:
		print('NO')
		continue
	k = i // 14
	if i % (14 * k) > 0 and i % (14 * k) < 7:
		print('YES')
	else:
		print('NO')


n = int(input())
x = list(map(int, input().split()))
for i in x:
	nd = i // 14
	mi = 14 * nd + 1
	if nd == 0:
		print('NO')
	elif mi <= i <= mi + 5:
		print('YES')
	else:
		print('NO')


t = int(input())
a = []
a = list(map(int, input().split()))
for i in a:
	if i < 15:
		print('NO')
	elif i % 14 >= 1 and i % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] <= 14:
		print('NO')
		continue
	ans = a[i] % 14
	if ans <= 6 and 0 < ans:
		print('YES')
	else:
		print('NO')


def solve(arr):
	for val in arr:
		if val not in [1, 2, 3, 4, 5, 6]:
			val = val % 14
			if val in [1, 2, 3, 4, 5, 6]:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
n = int(input())
arr = list(map(int, input().split()))
solve(arr)


import re
in1 = int(input())
in2 = [int(x) for x in re.split('\\s', input())]
for x in in2:
	if x <= 14:
		print('NO')
	else:
		x = x % 14
		if x >= 1 and x <= 6:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
t = int(input())
l = input().split()
li = [int(i) for i in l]
for i in li:
	z = i % 14
	if z >= 1 and z <= 6 and (i >= 14):
		print('YES')
	else:
		print('NO')


input()
a = [int(_) for _ in input().split()]
print(*('YES' if 1 <= c % 14 <= 6 and c > 14 else 'NO' for c in a))


def main():
	t = int(input())
	a = list(map(int, input().split()))
	for i in a:
		x = i // 14
		if x == 0:
			print('NO')
			continue
		k = i - (x - 1) * 14
		if k >= 15 and k <= 20:
			print('YES')
		else:
			print('NO')
	return
main()


a = int(input())
l = list(map(int, input().split()))
for x in l:
	if x // 14 > 0 and 0 < x % 14 <= 6:
		print('YES')
	else:
		print('NO')


import sys, os
from math import sqrt, gcd, ceil, log, floor, sin, pi
from math import factorial as fact
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
from itertools import permutations
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def f(arr):
	for i in 'abc':
		if not i in arr:
			return i

def main():
	n = int(input())
	arr = read()
	for i in arr:
		if i > 14 and 1 <= i % 14 <= 6:
			print('YES')
		else:
			print('NO')
main()


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
n = inn()
a = arr()
for i in a:
	if 1 <= i % 14 <= 6 and i // 14 >= 1:
		print('YES')
	else:
		print('NO')


n = int(input())
ii = [int(i) for i in input().split()]
for i in ii:
	if i >= 15 and i % 14 <= 6 and (i % 14 >= 1):
		print('YES')
	else:
		print('NO')


import sys
import math
t = int(input())
arr = list(map(int, input().split()))
for i in range(t):
	x = arr[i]
	if x >= 15 and x % 14 <= 6 and (x % 14 >= 1):
		print('YES')
	else:
		print('NO')


t = int(input())
ans = list()
x = list(map(int, input().split()))
for i in range(t):
	a = x[i]
	if a < 15:
		ans.append('NO')
	elif a == 15 or a == 16 or a == 17 or (a == 18) or (a == 19) or (a == 20):
		ans.append('YES')
	elif (a - 21) % 14 <= 13 and (a - 21) % 14 >= 8:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


n = int(input())
a = [int(w) for w in input().split()]
for i in range(n):
	if 1 <= a[i] % 14 <= 6 and a[i] > 14:
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for x in a:
	remain = x % 14
	if remain <= 6 and x >= 15 and (remain != 0):
		print('YES')
	else:
		print('NO')


t = int(input())
x = [int(s) for s in input().split(' ')]
for i in x:
	if 1 <= i % 14 <= 6 and i > 14:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
stdin.readline()
numbers = map(int, stdin.readline().split())

def check(n):
	if n < 15:
		return False
	m = n % 14
	return 1 <= m <= 6
for el in numbers:
	if check(el):
		stdout.write('YES')
	else:
		stdout.write('NO')
	stdout.write('\n')


n = int(input())
l = list(map(int, input().split()))
for j in l:
	if j % 14 > 0 and j % 14 < 7 and (j > 14):
		print('YES')
	else:
		print('NO')


input()
for e in map(int, input().split()):
	(q, r) = divmod(e, 14)
	if q >= 1 and r >= 1 and (r <= 6):
		print('YES')
		continue
	print('NO')


t = int(input())
arr = []
for i in range(0, 1):
	arr.append(list(map(int, input().split())))
for i in range(t):
	k = arr[0][i] // 14
	m = arr[0][i] % 14
	if k >= 1 and m >= 1 and (m <= 6):
		print('YES')
	else:
		print('NO')


n = int(input())
ar = [int(x) for x in input().split()]
for k in range(n):
	if ar[k] < 14:
		print('NO')
	elif ar[k] % 14 in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in l:
	if i < 21:
		if i >= 15:
			print('YES')
		else:
			print('NO')
	else:
		x = i % 14 + 14
		if x >= 15 and x <= 20:
			print('YES')
		else:
			print('NO')


n = int(input())
l = []
l = map(int, input().split())
for i in l:
	x = False
	if i < 15:
		x = False
	elif i % 14 == 0:
		x = False
	elif i % 14 < 7:
		x = True
	else:
		x = False
	if x:
		print('YES')
	else:
		print('NO')


T = int(input().strip())
A = list(map(int, input().split()))
for a in A:
	if a < 15:
		print('NO')
	elif 15 < a < 21:
		print('YES')
	else:
		mm = a // 14
		m = a - mm * 14
		if m == 1 or m == 2 or m == 3 or (m == 4) or (m == 5) or (m == 6):
			print('YES')
		else:
			print('NO')


import re
n = int(input())
st = input()
for t in re.finditer('[0-9]+', st):
	t = int(t.group(0))
	if t < 14:
		print('NO')
		continue
	elif 1 <= t % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
favorites = [int(x) for x in input().split()]
for t in favorites:
	reminder = t % 14
	if t > 14 and reminder >= 1 and (reminder <= 6):
		print('YES')
	else:
		print('NO')


n = int(input())
a = [int(i) for i in input().split()]
for i in a:
	if i < 15:
		print('NO')
	else:
		x = i // 14
		i -= x * 14
		if i > 6 or i == 0:
			print('NO')
		else:
			print('YES')


top = [15, 16, 17, 18, 19, 20]
n = int(input())
list = [x for x in map(int, input().split())]
for i in list:
	if i < 15:
		print('NO')
	else:
		for j in top:
			if (i - j) % 14 == 0:
				print('YES')
				break
		else:
			print('NO')


n = int(input())
for v in map(int, input().split()):
	r = v % 14
	print('YES' if v > 6 and r > 0 and (r < 7) else 'NO')


input()
for i in map(int, input().split()):
	t = 1
	if i > 6:
		for j in range(1, 7):
			if (i - 7 + j) % 14 == 0:
				t = 0
	print('YNEOS'[t::2])


input()
a = [int(x) for x in input().split()]
for x in a:
	if x > 14 and x % 14 > 0 and (x % 14 < 7):
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for k in range(n):
	p = a[k]
	f = 0
	for j in range(1, 7):
		if (p - j) % 7 == 0 and (p - j) // 7 % 2 == 0 and (p - j != 0):
			f = 1
			break
	print(['NO', 'YES'][f])


t = int(input())
a = [int(i) for i in input().split()]
for num in a:
	quotient = num // 14
	num %= 14
	print('YES' if num in [i for i in range(1, 7)] and quotient >= 1 else 'NO')


n = int(input())
vals = list(map(int, input().split(' ')))
for val in vals:
	if val < 14:
		print('NO')
		continue
	found = False
	for i in range(15, 21, 1):
		new = val - i
		if new % 14 == 0:
			found = True
			break
	if found:
		print('YES')
	else:
		print('NO')


n = int(input())
x = [int(i) for i in input().split()]
for i in x:
	if i <= 14:
		print('NO')
	elif i % 14 in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


k = int(input())
arr = list(map(int, input().split()))
for n in arr:
	if n > 14:
		if n % 14 > 6 or n % 14 == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


n = input()
a = list(map(int, input().split()))
for i in a:
	if i < 15:
		print('NO')
	else:
		temp = i % 14
		if temp < 7 and temp >= 1:
			print('YES')
		else:
			print('NO')


T = int(input())
s = set([1, 2, 3, 4, 5, 6])
A = list(map(int, input().strip().split()))
for i in A:
	if i < 15:
		print('NO')
	else:
		i = i % 14
		if i in s:
			print('YES')
		else:
			print('NO')


import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
Ans = [None] * N
for qu in range(N):
	a = A[qu]
	ans = 'NO'
	for i in range(1, 7):
		if (a - 7 + i) % 14 == 0 and a - 7 + i >= 14:
			ans = 'YES'
			break
	Ans[qu] = ans
print('\n'.join(Ans))


n = int(input())
arr = list(map(int, input().split()))
for i in arr:
	if i <= 14:
		print('NO')
	else:
		flg = False
		for j in range(1, 7):
			if (i - j) % 14 == 0:
				flg = True
		if flg:
			print('YES')
		else:
			print('NO')


t = int(input())
x = list(map(int, input().split()))
for i in x:
	j = i % 14
	if i > 14:
		if j > 0 and j < 7:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


input()
tests = map(int, input().split())
for n in tests:
	if n < 15:
		print('NO')
		continue
	if any(((n - i) % 14 == 0 for i in range(1, 7))):
		print('YES')
	else:
		print('NO')


t = input()
a = map(int, input().split(' '))
for x in a:
	d = x // 14
	if d == 0:
		print('NO')
	else:
		val = d * 14
		ase = False
		for i in range(1, 7):
			if val + i == x:
				ase = True
				break
		if ase:
			print('YES')
		else:
			print('NO')


n = int(input())
s = [int(x) for x in input().split()]
for i in s:
	y = i // 7
	x = i % 7
	if y % 2 == 0 and i > 7 and (x != 0):
		print('YES')
	else:
		print('NO')


n = int(input())
x = list(map(int, input().split()))
for number in x:
	d = number % 14
	t = number // 14
	if t <= 0 or (d > 6 or d < 1):
		print('NO')
	else:
		print('YES')


t = int(input())
b = list(map(int, input().split()))
for i in b:
	p = i // 14
	if p > 0:
		q = i % 14
		if q >= 1 and q <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from math import *
n = int(input())
a = list(map(int, input().split()))
for i in a:
	if 1 <= i % 14 <= 6 and i > 6:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in range(t):
	a = l[i] // 14
	b = l[i] - a * 14
	if b >= 1 and b <= 6 and (l[i] > 14):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	N = int(input())
	A = getlist()
	for x in A:
		if x <= 14:
			print('NO')
		elif 1 <= x % 14 and x % 14 <= 6:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
n = list(map(int, input().split()))
for i in n:
	k = i // 14
	r = i - 14 * k
	if k >= 1 and r <= 6 and (r > 0):
		print('YES')
	else:
		print('NO')


t = int(input())
ls = list(map(int, input().split()))
for i in range(t):
	if ls[i] <= 14:
		print('NO')
	elif ls[i] % 14 < 7 and ls[i] % 14 > 0:
		print('YES')
	else:
		print('NO')


from sys import stdin, exit
ntest = int(stdin.readline())
for test in map(int, stdin.readline().split()):
	ok = False
	for rem_face in range(1, 7):
		n = test
		n -= 21 - rem_face
		if n < 0 or n % 14 != 0:
			continue
		ok = True
		break
	print('YES' if ok else 'NO')


n = int(input())
arr = list(map(int, input().split()))
for x in arr:
	if x < 15:
		print('NO')
		continue
	if x % 14 >= 7 or x % 14 == 0:
		print('NO')
		continue
	else:
		print('YES')


t = int(input())
x = map(int, input().split())
for n in x:
	if n < 15:
		print('NO')
	else:
		print('YES' if 14 < n % 14 + 14 < 21 else 'NO')


t = int(input())
import sys
input = sys.stdin.readline
t = 1
while t > 0:
	t -= 1
	a1 = [int(x) for x in input().split()]
	for a in a1:
		p = a // 21 + 1
		q = 21 * p - a - 7 * (p - 1)
		if q < 0:
			q = q - q // 14 * 14
		if 1 <= q <= 6:
			print('YES')
		else:
			print('NO')


t = int(input())
l1 = [int(x) >= 14 and int(x) % 14 and (int(x) % 14 <= 6) for x in input().split()]
for x in l1:
	if x:
		print('YES')
	else:
		print('NO')


x = int(input())
s = list(input().split())
for n in s:
	p = int(n)
	if p % 14 >= 1 and p % 14 <= 6 and (p >= 15):
		print('YES')
	else:
		print('NO')


t = int(input())
v = list(map(int, input().rstrip().split()))
for i in range(len(v)):
	if v[i] < 21:
		if 21 - v[i] in [1, 2, 3, 4, 5, 6]:
			print('YES')
		else:
			print('NO')
	elif v[i] - 14 * (v[i] // 14) in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
n = iinp()
arr = lmp()
print(*['YES' if i > 14 and 1 <= i % 14 <= 6 else 'NO' for i in arr], sep='\n')


n = int(input())
x = list(map(int, input().split()))
for i in range(n):
	if x[i] > 14:
		r = x[i] % 14
		if r == 1 or r == 2 or r == 3 or (r == 4) or (r == 5) or (r == 6):
			print('YES')
		else:
			print('NO')
	elif x[i] <= 14:
		print('NO')


input()
for i in map(int, input().split()):
	if i > 14 and i % 14 >= 1 and (i % 14 <= 6):
		print('YES')
	else:
		print('NO')


int(input())
k = list(map(int, input().split()))
for i in k:
	print('YES' if i % 14 > 0 and i % 14 <= 6 and (i > 14) else 'NO')


def solve(li):
	for n in li:
		if n <= 14:
			print('NO')
		elif n % 14 <= 6 and n % 14 != 0:
			print('YES')
		else:
			print('NO')
q = int(input())
L = map(int, input().split())
solve(L)


def solution(t):
	ans = []
	for i in range(0, len(t)):
		if t[i] > 14 and (t[i] % 14 <= 6 and t[i] % 14 != 0):
			ans.append('YES')
		else:
			ans.append('NO')
	return ans

def main():
	t = int(input())
	nums = list(map(int, input().split()))
	ans = solution(nums)
	for i in range(0, len(ans)):
		print(ans[i])
main()


import math
t = int(input())
s1 = input()
for data in s1.split():
	x = int(data)
	aa = x % 14
	if x <= 14:
		print('NO')
		continue
	if aa >= 1 and aa <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
xi = list(map(int, input().split()))
for el in xi:
	di = el % 14
	if di > 0 and di < 7 and (el > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	if i < 15:
		print('NO')
		continue
	if i % 14 < 7 and i % 14 > 0:
		print('YES')
	else:
		print('NO')


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()
ii()
a = li()
for i in a:
	print('YES' if i > 14 and 0 < i % 14 < 7 else 'NO')


t = int(input())
s = input().split()
for i in range(0, len(s)):
	a = int(s[i]) % 14
	if a > 0 and a < 7 and (int(s[i]) > 14):
		print('YES')
	else:
		print('NO')


topCube = {20, 19, 18, 17, 16, 15}
input()
for n in input().strip().split():
	n = int(n)
	if n > 14 and n % 14 > 0 and (n % 14 < 7):
		print('YES')
	else:
		print('NO')


a = input()
for j in list(map(int, input().split())):
	print('YNEOS'[1 - (j % 14 in range(1, 7) and j > 14)::2])


n = int(input())
l = list(map(int, input().split()))
r = [15, 16, 17, 18, 19, 20]
for i in l:
	if i < 15:
		print('NO')
	elif i in r:
		print('YES')
	elif i % 14 < 7 and i % 14 > 0:
		print('YES')
	else:
		print('NO')


def check(num):
	if 15 <= num <= 20:
		return 'YES'
	elif num >= 29:
		for i in [20, 19, 18, 17, 16, 15]:
			sub_num = num - i
			if sub_num % 14 == 0:
				return 'YES'
	return 'NO'
size = int(input())
arr = list(map(int, input().split()))
for i in range(size):
	print(check(arr[i]))


elem = int(input())
ar = []
for el in input().split(' '):
	ar.append(int(el))
for n in ar:
	if n < 15:
		print('NO')
		continue
	if n % 14 < 7 and n % 14 != 0:
		print('YES')
	else:
		print('NO')


_ = input()
for s in input().split(' '):
	num = int(s)
	f = num % 14
	if num == 0 or (num > 14 and 7 > f > 0):
		print('YES')
	else:
		print('NO')


n = int(input())

def f(x):
	if x < 21:
		print('YES' if x > 14 else 'NO')
		return
	tmp = x - 14 * (x // 14)
	while tmp < 21:
		tmp += 14
	tmp -= 14
	print('YES' if tmp > 14 else 'NO')
for i in map(int, input().split()):
	f(i)


n = int(input())
a = list(map(int, input().split(' ')))
for i in a:
	if i < 21:
		if i <= 14:
			print('NO')
		else:
			print('YES')
	elif i % 14 == 0:
		print('NO')
	else:
		d = i // 14
		e = 14 * d
		if i - e < 7 and i - e > 0:
			print('YES')
		else:
			print('NO')


import sys
import math
input = sys.stdin.readline
t = int(input())
a = list(map(int, input().split()))
for i in a:
	rem = i % 14
	if rem <= 6 and rem >= 1 and (i > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
a = [*map(int, input().split())]
print(*['YES' if 1 <= c % 14 <= 6 and c > 14 else 'NO' for c in a])


arr1 = [15, 16, 17, 18, 19, 20]
n = int(input())
arr = list(map(int, input().split()))
for i in arr:
	if i in arr1:
		print('YES')
	elif i < 15:
		print('NO')
	else:
		lock = 1
		for j in arr1:
			if (i - j) % 14 == 0:
				lock = 0
				break
		if lock == 1:
			print('NO')
		else:
			print('YES')


from copy import copy

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())

def comp(a):
	return a[0]
t = int_inp()
arr = arr_int_inp()
for x in arr:
	if x > 14 and 1 <= x % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
A = list(map(int, input().split()))
for i in range(n):
	if A[i] < 15:
		print('NO')
	elif (A[i] - 1) % 14 == 0:
		print('YES')
	elif (A[i] - 2) % 14 == 0:
		print('YES')
	elif (A[i] - 3) % 14 == 0:
		print('YES')
	elif (A[i] - 4) % 14 == 0:
		print('YES')
	elif (A[i] - 5) % 14 == 0:
		print('YES')
	elif (A[i] - 6) % 14 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
x = [int(x) for x in input().split(' ')]
for i in x:
	if i % 14 != 0 and i % 14 <= 6 and (i > 14):
		print('YES')
	else:
		print('NO')


input()
t = [int(x) for x in input().split()]
for i in t:
	print('YNEOS'[not (i > 14 and i % 14 in [1, 2, 3, 4, 5, 6])::2])


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	l = li()
	for i in range(n):
		x = l[i]
		if x < 15:
			print('NO')
			continue
		r = x % 14
		if r <= 6 and r > 0:
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
	if 1 <= l[i] % 14 <= 6 and l[i] // 14 >= 1:
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for i in a:
	if i < 15:
		print('NO')
	elif 0 < i % 14 < 7:
		print('YES')
	else:
		print('NO')


x = int(input())
y = input().split()
for i in range(x):
	if int(y[i]) > 14 and int(y[i]) % 14 <= 6 and (int(y[i]) % 14 != 0):
		print('YES')
	else:
		print('NO')


jk = int(input())
li = input().split(' ')
for nj in range(len(li)):
	li[nj] = int(li[nj])
yv = [1, 2, 3, 4, 5, 6]
for chai in range(len(li)):
	if li[chai] % 14 in yv and li[chai] > 6:
		print('YES')
	else:
		print('NO')


n = int(input())
S = list(map(int, input().split()))
for i in S:
	if i // 14 == 0:
		if i <= 20 and i >= 15:
			print('YES')
		else:
			print('NO')
	elif i % 14 >= 1 and i % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
array = list(map(int, input().split()))
for u in array:
	if u >= 15 and 1 <= u % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	s = a[i] % 14
	if s > 6 or s < 1:
		print('NO')
	elif a[i] < 15:
		print('NO')
	else:
		print('YES')


n = int(input())
t = list(map(int, input().split()))
for k in range(len(t)):
	if t[k] >= 14:
		if 1 <= t[k] % 14 <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	if i <= 14:
		print('NO')
	elif 1 <= i % 14 <= 6:
		print('YES')
	else:
		print('NO')


import sys

def a(target):
	target = target % 14
	for i in range(1, 7):
		if i == target:
			return True
	return False
n = sys.stdin.readline()
targets = [int(i) for i in sys.stdin.readline().strip().split(' ')]
for target in targets:
	if target == 0:
		print('YES')
	elif target < 14:
		print('NO')
	elif a(target):
		print('YES')
	else:
		print('NO')


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import *
(n, a) = (int(input()), arr_inp())
for i in a:
	if i // 7 % 2 or i < 15 or i % 7 == 0:
		print('NO')
	else:
		print('YES')


rd = lambda : list(map(int, input().split()))
n = int(input())
a = rd()
for i in a:
	pos = 0
	if i < 15:
		print('NO')
		continue
	for j in range(i - 6, i):
		if j % 14 == 0:
			pos = 1
			break
	if pos:
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for x in a:
	if x <= 14:
		print('NO')
	else:
		r = x % 14
		y = [1, 2, 3, 4, 5, 6]
		z = 0
		for c in y:
			if r == c:
				z = 1
				break
			else:
				continue
		if z == 1:
			print('YES')
		else:
			print('NO')


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	yes = False
	for j in range(1, 7):
		if (a[i] - j) % 14 == 0 and a[i] > 14:
			yes = True
	if yes == True:
		print('YES')
	else:
		print('NO')


down_up = {1: 6, 6: 1, 2: 5, 5: 2, 3: 4, 4: 3}
top_dice = {21 - i for i in range(1, 7)}
middle_dice = {21 - top - bottom for (top, bottom) in down_up.items()}

def solve(num, top_dice):
	if num <= 14:
		return False
	for t_d in top_dice:
		if (num - t_d) % 14 == 0:
			return True
	return False
_ = input()
nums = list(map(int, input().strip().split(' ')))
for num in nums:
	if solve(num, top_dice):
		print('YES')
	else:
		print('NO')


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
for a in LIST():
	if a // 14 >= 1 and 1 <= a % 14 <= 6:
		YES()
	else:
		NO()


b = int(input())
for num in [int(n) for n in input().split()]:
	if num > 14 and 1 <= num % 14 <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
lst = list(map(int, input().split()))
for i in lst:
	c = i // 14
	d = i % 14
	if d in [1, 2, 3, 4, 5, 6] and c >= 1:
		print('YES')
	else:
		print('NO')


import sys, itertools
tc = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
for i in arr:
	dice_num = (i - 1) // 14
	if dice_num == 0:
		print('NO')
	elif 14 * dice_num + 1 <= i <= 14 * dice_num + 6:
		print('YES')
	else:
		print('NO')


input()
n = list(map(int, input().split(' ')))

def verify(pips):
	temp = pips // 7
	if temp % 2 == 0 and temp > 1:
		top = pips - temp * 7
		if top >= 1 and top <= 6:
			return 'YES'
	return 'NO'
for pips in n:
	print(verify(pips))


n = int(input())
s = map(int, input().split(' '))
for fn in s:
	if 0 < fn % 14 <= 6 and fn / 14 > 1:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = list(map(int, input().split()))
for i in range(len(arr)):
	c = arr[i]
	if c <= 14:
		print('NO')
	elif c % 14 <= 6 and c % 14 >= 1:
		print('YES')
	else:
		print('NO')


T = int(input())
x_list = list(map(int, input().split(' ')))
for x in x_list:
	a = x % 14
	if a >= 1 and a < 7 and (x > 14):
		print('YES')
	else:
		print('NO')


n = input()
n = int(n)
s = list(map(lambda x: int(x), input().split()))
for num in s:
	if num >= 15 and 1 <= num % 14 <= 6:
		print('YES')
	else:
		print('NO')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdarr = lambda : map(int, stdstr().split())
mod = 1000000007
n = stdint()
arr = list(stdarr())
for i in range(n):
	if arr[i] // 14 > 0 and 1 <= arr[i] % 14 <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
values = list(map(int, input().split()))
for i in values:
	flag = 0
	if i > 14:
		if i % 14 == 0:
			flag = 0
		else:
			while i > 0:
				rem = i % 14
				i = i // 14
				if rem < 14 and rem > 0:
					if rem < 7:
						flag = 1
					break
	if flag == 1:
		print('YES')
	else:
		print('NO')


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
n = int(input())
l = list(map(int, input().split()))
cnt = 5
for _ in range(100000):
	cnt += 1
for i in l:
	flag = 0
	for j in range(1, 7):
		ka = i - (7 - j)
		if ka % 14 == 0:
			if ka // 14 != 0:
				flag = 1
				break
	if flag == 1:
		print('YES')
	else:
		print('NO')


a = int(input())
li = list(map(int, input().split()))
li1 = []
for i in li:
	c = i % 14
	if i > 14 and c > 0 and (c < 7):
		li1.append('YES')
	else:
		li1.append('NO')
for i in li1:
	print(i)


n = int(input())
y = list(map(int, input().split()))
for i in y:
	if i < 15:
		print('NO')
	else:
		i = i - 7
		if (i + 1) % 14 == 0 or (i + 2) % 14 == 0 or (i + 3) % 14 == 0 or ((i + 4) % 14 == 0) or ((i + 5) % 14 == 0) or ((i + 6) % 14 == 0):
			print('YES')
		else:
			print('NO')


from os import path
import sys
from math import ceil, floor, gcd, log
from collections import defaultdict, Counter
maxx = float('inf')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
else:
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
n = I()
ls = lint()
for i in ls:
	x = i % 14
	if 1 <= x <= 6 and i // 14 >= 1:
		print('YES')
	else:
		print('NO')


a = input()
b = input().split(' ')
for q in range(int(a)):
	if int(b[q]) % 14 < 7 and int(b[q]) > 14 and (int(b[q]) % 14 != 0 or int(b[q]) == 14):
		print('YES')
	else:
		print('NO')


t = int(input())
a = [int(i) for i in input().split()]
for i in range(t):
	ans = 'NO'
	dice = (a[i] - 7) // 14 + 1
	if dice > 0:
		if dice * 21 - 7 * (dice - 1) - 6 <= a[i] <= dice * 21 - 7 * (dice - 1) - 1:
			ans = 'YES'
	print(ans)


t = int(input())
lista = input().split()
for i in range(t):
	lista[i] = int(lista[i])
for j in lista:
	if 1 <= j % 14 <= 6 and j > 14:
		print('YES')
	else:
		print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
lst = get_int_list()
for num in lst:
	i = num // 14 - 1
	residue = num - i * 14
	if residue in {15, 16, 17, 18, 19, 20} and i >= 0:
		print('YES')
	else:
		print('NO')


n = int(input())
fav_ints = list(map(int, input().split()))
for f in fav_ints:
	flag = False
	if f <= 14:
		flag = False
	elif f % 7 != 0 and f // 7 % 2 == 0:
		flag = True
	if flag:
		print('YES')
	else:
		print('NO')


n = int(input())
L = list(map(int, input().split()))
for l in L:
	if l <= 14:
		print('NO')
		continue
	b = True
	for j in range(1, 7):
		if (l - j) % 14 == 0:
			b = False
			print('YES')
			continue
	if b == True:
		print('NO')


def main():
	n = int(input())
	tab = input().split()
	for i in range(n):
		x = int(tab[i])
		if x // 14 == 0:
			print('NO')
		elif x % 14 > 0 and x % 14 < 7:
			print('YES')
		else:
			print('NO')
main()


import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict

def solution(arr):
	for x in arr:
		yes = False
		possible = range(15, 21)
		if x < 15:
			write('NO')
		elif x in possible:
			write('YES')
		else:
			for p in possible:
				if (x - p) % 14 == 0:
					write('YES')
					yes = True
					break
			if not yes:
				write('NO')

def main():
	for _ in range(r_int()):
		arr = r_array()
		solution(arr)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


t = int(input())
lis = []
lis = list(map(int, input().split(' ')[:t]))
sum = 21
nr = 0
for i in lis:
	t = i % 14
	d = i // 14
	if (t >= 1 and t <= 6) and d >= 1:
		print('YES')
	else:
		print('NO')


inp = input
n = inp()
arr = map(int, inp().strip().split(' '))
arr = list(arr)
for a in arr:
	rem = a % 14
	if a < 15:
		print('NO')
	elif rem == 0 or rem > 6:
		print('NO')
	else:
		print('YES')


nu = int(input().strip())
arr = [int(x) for x in input().strip().split()]
for n in arr:
	if n < 15:
		print('NO')
	else:
		val = False
		for i in range(15, 21):
			if (n - i) % 14 == 0:
				val = True
				break
		if val:
			print('YES')
		else:
			print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in l:
	if i < 14:
		print('NO')
		continue
	if i % 14 == 0:
		print('NO')
	else:
		d = i % 14
		if d <= 6:
			print('YES')
		else:
			print('NO')


import sys
t = int(sys.stdin.readline())
x = [int(i) for i in sys.stdin.readline().split()]
ans_arr = []
for e in range(t):
	val = x[e] % 14
	if 1 <= x[e] <= 6:
		ans_arr.append('NO')
	elif 1 <= val <= 6:
		ans_arr.append('YES')
	else:
		ans_arr.append('NO')
print('\n'.join(ans_arr))


t = int(input())
a = list(map(int, input().split()))
for i in a:
	x = i % 14
	y = i // 14
	if 0 < x <= 6 and y > 0:
		print('YES')
	else:
		print('NO')


x = int(input())
z = list(map(int, input().split()))
for y in z:
	if y % 14 > 0 and y % 14 < 7 and (y > 7):
		print('yes')
	else:
		print('no')


def main_function():
	input()
	x = [int(i) for i in input().split(' ')]
	for i in x:
		if i < 15:
			print('NO')
			continue
		i = i % 14
		if i < 7 and i > 0:
			print('YES')
		else:
			print('NO')
main_function()


n = int(input())
l = list(map(int, input().split()))
l1 = [x % 14 if x > 14 else 0 for x in l]
for i in l1:
	if i in (1, 2, 3, 4, 5, 6):
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for i in a:
	ans = 0
	if i < 15:
		ans = 0
	else:
		d = int(i) // 14
		m = 14 * d
		if i >= m + 1:
			if i <= m + 6:
				ans = 1
	if ans:
		print('YES')
	else:
		print('NO')


a = int(input())
b = list(map(int, input().split()))
for i in b:
	if i <= 14:
		print('NO')
	elif 20 >= i > 14:
		print('YES')
	elif i % 14 > 6 or i % 14 == 0:
		print('NO')
	else:
		print('YES')


n = input()
for x in map(int, input().split()):
	if x % 7 == 0 or x < 14:
		print('NO')
		continue
	if x // 7 % 2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
tests = [int(j) for j in input().split()]
for n in tests:
	flag = 0
	base = [i for i in range(1, 15)]
	if n in base:
		print('NO')
		continue
	for i in range(1, 7):
		x = n - i
		if x % 14 == 0:
			flag = 1
			break
	if flag == 1:
		print('YES')
	else:
		print('NO')


am = int(input())
nums = list(map(int, input().split()))
for i in nums:
	if i < 15:
		print('NO')
		continue
	print('YES' if i // 7 % 2 == 0 and i % 7 > 0 else 'NO')


import sys
t = int(input())
a = [int(x) for x in input().split()]
for ai in a:
	if ai > 14 and ai % 14 < 7 and (ai % 14 > 0):
		print('YES')
	else:
		print('NO')


t = int(input())
arr = list(map(int, input().split()))
choice = [1, 2, 3, 4, 5, 6]
for ans in arr:
	flag = False
	for j in range(6):
		b = (ans - choice[j]) // 14
		n = (ans - choice[j]) % 14
		if b >= 1 and n == 0:
			print('YES')
			flag = True
			break
	if flag == False:
		print('NO')


sums = [20, 19, 18, 17, 16, 15]
T = int(input())
a = list(map(int, input().split()))
for n in a:
	res = n % 14
	if n >= 15 and res in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


t = int(input())
x = list(map(int, input().split()))
for i in range(t):
	a = x[i] // 14
	b = x[i] % 14
	if a > 0 and b > 0 and (b < 7):
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	if i in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, 26, 27, 28]:
		print('NO')
	elif i % 14 in [7, 8, 9, 10, 11, 12, 13, 0]:
		print('NO')
	else:
		print('YES')


n: int = int(input())
a = input().split(' ')
if len(a) != n:
	exit()
for number in a:
	if int(number) < 15:
		print('NO')
		continue
	d = (int(number) - 15) % 14
	if 0 <= d <= 5:
		print('YES')
		continue
	print('NO')


n = int(input())
nli = [int(i) for i in input().split()]
for a in nli:
	if a % 14 < 7 and a > 14 and (a % 14 != 0):
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(str, input().split()))
for i in a:
	i = int(i)
	x = i // 7
	if x % 2 == 0 and i % 7 != 0 and (i > 7):
		print('YES')
	else:
		print('NO')


a = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
	LOL = A[i]
	if LOL > 14:
		LOL %= 14
		if 1 <= LOL <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


kl = int(input())
s = [int(i) for i in input().split()]
a = {1, 2, 3, 4, 5, 6}
for i in range(kl):
	if (s[i] % 14 in a or s[i] == 0) and s[i] > 14:
		print('YES')
	else:
		print('NO')


t = int(input())
li = [int(x) for x in input().split(' ')]
for j in li:
	if j % 14 + 14 in [20, 19, 18, 17, 16, 15] and j >= 14:
		print('YES')
	else:
		print('NO')


k = int(input())
list1 = [*map(int, input().split())]
for i in list1:
	t = i % 14
	d = i // 14
	if d >= 1 and t <= 6 and (t >= 1):
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for x in range(t):
	q = a[x]
	ans = q % 14
	if ans >= 1 and ans <= 6 and (q // 14 >= 1):
		print('YES')
	else:
		print('NO')


n = int(input())
ar = list(map(int, input().split()))
ans = []
for elem in ar:
	if elem % 14 <= 6 and elem >= 15 and (elem % 14 != 0):
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for i in range(t):
	if a[i] >= 15 and 0 <= (a[i] - 15) % 14 <= 5:
		print('YES')
	else:
		print('NO')


def main(number):
	if number < 15:
		print('NO')
		return
	ans = number % 14 in range(1, 6 + 1)
	ans = 'YES' if ans else 'NO'
	print(ans)
n = int(input())
numbers = input().split()
numbers = map(int, numbers)
for number in numbers:
	main(number)


line = input()
l = input().split()
for i in l:
	if int(i) < 15:
		print('NO')
	else:
		s = int(i) // 14
		s = s - 1
		res = int(i) - s * 14
		if res > 14 and res < 21:
			print('YES')
		else:
			print('NO')


n = int(input())
s = input()
for i in s.split(' '):
	n = int(i)
	ost = n % 14
	if ost <= 6 and ost != 0 and (n >= 15):
		print('YES')
	else:
		print('NO')


n = int(input())
x_i = map(int, input().split())
for i in x_i:
	if i < 15:
		print('NO')
		continue
	f = i % 14
	if f >= 1 and f <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for j in range(0, len(a)):
	if a[j] % 14 >= 1 and a[j] % 14 <= 6 and (a[j] > 14):
		print('yes')
	else:
		print('no')


from math import gcd, ceil
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def pred(n, k, pointer):
	return pointer - k >= n

def yes():
	print('YES')

def no():
	print('NO')
Testcase = inin()
for n in inar():
	if 1 <= n % 14 <= 6 and n > 14:
		yes()
	else:
		no()


t = int(input())
a = list(map(int, input().split()))
for i in a:
	if 15 <= i <= 20 or (15 <= i % 14 + 14 <= 20 and i > 20):
		print('YES')
	else:
		print('NO')


x = int(input())
arr = [int(i) for i in input().split()]
for n in arr:
	if n >= 15:
		x = n // 14 - 1
		min1 = 15
		max1 = 20
		flag = 0
		if n - x * 14 <= max1 and n - x * 14 >= min1:
			for i in range(1, 7):
				if x * 14 + (21 - i) == n:
					flag = 1
					break
		if flag == 1:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
n = int(input())
a = arrIN()
for i in a:
	if i < 15:
		print('NO')
	elif 15 <= i <= 20:
		print('YES')
	else:
		rem = i % 14
		if rem < 1 or rem > 6:
			print('NO')
		else:
			print('YES')


input()
for s in [int(s) for s in input().split()]:
	print('YNEOS'[not (s > 14 and s % 14 in range(1, 6 + 1))::2])


n = int(input())
m = list(map(int, input().split()))
a = []
for i in range(n):
	if m[i] <= 14:
		a.append('NO')
	else:
		z = m[i] % 14
		if z <= 6 and z > 0:
			a.append('YES')
		else:
			a.append('NO')
print(*a, sep='\n')


n = int(input())
lis = [int(x) for x in input().split()]
numbers = [1, 2, 3, 4, 5, 6]
for j in lis:
	if j % 14 in numbers and j not in numbers:
		print('YES')
	else:
		print('NO')


n = int(input())
l = [int(x) for x in input().split()]
for i in l:
	if i > 14:
		k = i % 14
		if k > 0 and k <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
m = 7 * 2
for i in l:
	rem = i % m
	if rem >= 1 and rem <= 6 and (i >= 15):
		print('YES')
	else:
		print('NO')


import sys
from collections import defaultdict, deque
import math

def inar():
	return [int(ek) for ek in input().split()]
t = int(input())
arr = inar()
for i in range(t):
	n = arr[i]
	if n > 14 and (n % 14 == 1 or n % 14 == 6 or n % 14 == 3 or (n % 14 == 4) or (n % 14 == 5) or (n % 14 == 2)):
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for nb in l:
	if nb < 15:
		print('NO')
	elif nb % 14 + 14 in (15, 16, 17, 18, 19, 20):
		print('YES')
	else:
		print('NO')


n = int(input())
a2 = [20, 19, 18, 17, 16, 15]
a = [int(x) for x in input().split()]
for x in a:
	num = x % 14
	if num in a2 or (x >= num + 14 and num + 14 in a2):
		print('YES')
	else:
		print('NO')


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('0') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = inputnum()
x = inputlist()
for i in x:
	if i % 14 > 0 and i % 14 < 7 and (i > 14):
		print('YES')
	else:
		print('NO')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from collections import defaultdict as dd
d = [20, 19, 18, 17, 16, 15]
(n,) = I()
a = I()
for x in a:
	ans = 'NO'
	for j in d:
		ok = x - j
		if ok >= 0 and ok % 14 == 0:
			ans = 'YES'
			break
	print(ans)


N = int(input())
X = list(map(int, input().split()))
for x in X:
	if x % 14 in (1, 2, 3, 4, 5, 6) and x >= 15:
		print('YES')
	else:
		print('NO')


import os
import sys

def main():
	T = read_int()
	X = read_ints()
	for x in X:
		print('YES' if solve(x) else 'NO')

def solve(X):
	if X < 15:
		return False
	X -= 15
	return 0 <= X % 14 <= 5
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


n = int(input())
x = list(map(int, input().split()))
for i in range(n):
	c1 = x[i] % 14
	c2 = x[i] // 14
	if c1 >= 1 and c1 <= 6 and (c2 >= 1):
		print('YES')
	else:
		print('NO')


t = int(input())
arr = [int(x) for x in input().split()]
for item in arr:
	rem = item % 14
	if item > 14 and rem > 0 and (rem < 7):
		print('YES')
	else:
		print('NO')


noInputs = int(input())
nums = input().split()
for i in range(noInputs):
	if int(nums[i]) <= 14:
		print('No')
	else:
		res = int(nums[i]) % 14
		if res == 1 or res == 2 or res == 3 or (res == 4) or (res == 5) or (res == 6):
			print('Yes')
		else:
			print('No')


int(input())
arr = [int(x) for x in input().split()]
for i in arr:
	print('YES' if i % 14 > 0 and i % 14 < 7 and (i > 14) else 'NO')


n = int(input())
nums = input().split()
for i in range(len(nums)):
	nums[i] = int(nums[i])
for num in nums:
	rem = num % 14
	if 1 <= rem <= 6 and (not num < 15):
		print('YES')
	else:
		print('NO')


n = int(input())
c = input()
for _ in range(n):
	b = c.find(' ')
	if b == -1:
		a = c[0:len(c) + 1]
	else:
		a = c[0:b]
	c = c[b + 1:len(c) + 1]
	a = int(a)
	if a < 15:
		print('NO')
		continue
	a = a % 14
	if (a < 7) & (a > 0):
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	a = l[i] // 14
	b = l[i] % 14
	if a >= 1 and b < 7 and (b >= 1):
		print('YES')
	else:
		print('NO')


import math
n = int(input())
l = list(map(int, input().split()))
for i in l:
	d = math.floor(i / 14)
	t = i % 14
	if 1 <= t <= 6 and d >= 1:
		print('YES')
	else:
		print('NO')


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import math
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7
test = int_input()
arr = list_input()
for n in arr:
	if n % 14 <= 6 and n % 14 >= 1 and (n >= 15):
		print('YES')
	else:
		print('NO')


def program(x):
	if x <= 14:
		print('No')
		return 0
	x = x % 14
	if x <= 6 and x >= 1:
		print('YES')
	else:
		print('NO')
t = int(input())
l = list(map(int, input().split()))
for x in l:
	program(x)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
rint()
for i in rints():
	print('YES' if any(((i - 21 + j) % 14 == 0 and i - 21 + j >= 0 for j in range(1, 7))) else 'NO')


T = int(input())
Num = list(map(int, input().split()))
for i in Num:
	if i % 14 < 7 and i % 14 > 0 and (i > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for t in a:
	possible = False
	kval = 0
	for k in range(1, 7):
		if (t - 7 + k) % 14 == 0:
			possible = True
			kval = k
			break
	if not possible:
		print('NO')
		continue
	if possible and (t - 7 + kval) // 14 >= 1:
		print('YES')
		continue
	print('NO')


l = [20, 19, 18, 17, 16, 15]
t = int(input())
xl = list(map(int, input().split()))
for x in xl:
	f = 1
	for i in l:
		if (x - i) % 14 == 0 and (x - i) // 14 >= 0:
			print('YES')
			f = 0
	if f == 1:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
num = 0
for i in l:
	list1 = []
	num = i // 14
	if num > 0:
		for j in range(1, 7):
			list1.append(14 * num + j)
		if i in list1:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
x = str(input()).split(' ')
for v in x:
	if int(v) < 15:
		print('NO')
		continue
	v = int(v) % 14
	if 1 <= v and v <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
a = [int(n) for n in input().split()]
for i in range(len(a)):
	l = 15
	u = 20
	f = 0
	if a[i] < 15:
		print('NO')
	elif a[i] % 14 >= 1 and a[i] % 14 <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in l:
	if i > 14 and i % 14 in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	f = 0
	for j in range(15, 21):
		if (i - j) % 14 == 0 and i >= 15:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


n = int(input())
A = [int(i) for i in input().split()]
for a in A:
	if a < 15:
		print('NO')
	else:
		ax = a % 14
		if ax > 0 and ax < 7:
			print('YES')
		else:
			print('NO')


from decimal import Decimal

def get(x):
	for i in (1, 2, 3, 4, 5, 6):
		if not Decimal(x - i) / 14 % 1:
			return True
	return False
n = input()
l = list(map(int, input().split()))
for x in l:
	if x < 15:
		print('NO')
		continue
	if get(x):
		print('YES')
	else:
		print('NO')


import sys
(t, *x) = map(int, sys.stdin.read().split())

def main():
	for i in x:
		(q, r) = divmod(i, 14)
		if q >= 1 and 1 <= r <= 6:
			yield 'YES'
		else:
			yield 'NO'
ans = main()
print(*ans, sep='\n')


t = int(input())
a = list(map(int, input().split()))
for v in a:
	(x, y) = divmod(v, 14)
	if x >= 1 and 1 <= y <= 6:
		print('YES')
	else:
		print('NO')


def tower(pips):
	for i in pips:
		if i % 14 > 0 and i % 14 <= 6 and (i > 14):
			print('YES')
		else:
			print('NO')
a = int(input())
b = list(map(int, input().split()))
tower(b)


t = int(input(''))
x = [int(x) for x in input('').split()]
for d in range(t):
	n = x[d]
	e = n % 14
	if 1 <= e <= 6 and n >= 15:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = list(map(int, input().split()))
ans = []
for i in arr:
	d = i // 14
	t = i % 14
	if d >= 1 and t >= 1 and (t < 7):
		print('YES')
	else:
		print('NO')


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
t = int(input())
for el in map(int, input().split()):
	if el > 14 and 0 < el % 14 < 7:
		print('YES')
	else:
		print('NO')


no_testcases = int(input())
numlist = list(map(int, input().split()))
for number in numlist:
	if number % 14 >= 1 and number % 14 <= 6 and (number >= 15):
		print('YES')
	else:
		print('NO')


c = int(input())
l = [int(x) for x in input().split()]
for e in l:
	if e > 14 and e % 14 >= 1 and (e % 14 <= 6):
		print('YES')
	else:
		print('NO')


t = int(input())
l = [int(x) for x in input().split()]
l1 = [1, 2, 3, 4, 5, 6]
l2 = []
for j in l:
	c = j % 14
	if c in l1 and j >= 14:
		l2.append('YES')
	else:
		l2.append('NO')
for j in l2:
	print(j)


t = int(input(''))
x = [int(n) for n in input('').split(' ')[:t]]
ans = ['NO', 'YES']
for n in x:
	print(ans[int(n % 14 != 0 and n % 14 < 7 and (n > 14))])


n = int(input())
l = [int(x) for x in input().split()]
for i in range(len(l)):
	if l[i] < 15:
		print('NO')
	else:
		l[i] -= 15
		low = l[i] // 14 * 14
		if low <= l[i] <= low + 5:
			print('YES')
		else:
			print('NO')


t = int(input())
x = list(map(int, input().split()))
for i in range(t):
	if x[i] < 15:
		print('NO')
	elif x[i] % 14 > 6 or x[i] % 14 == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
l1 = list(map(int, input().split()))
for x in l1:
	if 0 < x % 14 < 7 and x > 14:
		print('YES')
	else:
		print('NO')


import sys

def ints():
	return list(map(int, sys.stdin.readline().strip().split()))
tc = 1
while tc:
	tc -= 1
	n = input()
	ls = ints()
	for n in ls:
		if n > 14 and n % 14 != 0 and (n % 14 < 7):
			print('YES')
		else:
			print('NO')


n = int(input())
n = list(map(int, input().split()))
for i in n:
	a = i
	if a == 0:
		print('yes')
		continue
	if a < 14:
		print('no')
		continue
	if a % 14 <= 6 and a % 14 != 0:
		print('yes')
	else:
		print('no')


N = int(input())
for x in input().split():
	x = int(x)
	m = x % 14
	if 1 <= m <= 6 and x >= 15:
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
c = 0
for i in l:
	if i >= 15:
		c = i % 14
		if c >= 1 and c <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


ar1 = [15, 16, 17, 18, 19, 20]
n = int(input())
ar = list(map(int, input().split()))
count = 0
val = 0
for i in ar:
	if i < 15:
		print('NO')
	elif i >= 15 and i <= 20:
		print('YES')
	else:
		count = i // 14
		val = i - 14 * (count - 1)
		if val in ar1:
			print('YES')
		else:
			print('NO')


t = int(input())
xs = map(int, input().split())
for x in xs:
	if 1 <= x % 14 <= 6 and x > 14:
		print('YES')
	else:
		print('NO')


t = int(input())
s = list(map(int, input().split()))
for i in range(len(s)):
	if s[i] < 15:
		print('NO')
		continue
	if (s[i] - 15) % 14 == 0 or (s[i] - 16) % 14 == 0 or (s[i] - 17) % 14 == 0 or ((s[i] - 18) % 14 == 0) or ((s[i] - 19) % 14 == 0) or ((s[i] - 20) % 14 == 0):
		print('YES')
	else:
		print('NO')


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip().split(' ')
assert len(s) == n
for i in s:
	i = int(i)
	if i % 14 >= 1 and i % 14 <= 6 and (i >= 15):
		print('YES')
	else:
		print('NO')


def f(n):
	n -= 14
	if n <= 0:
		return 'NO'
	rem = n % 14
	if rem >= 1 and rem <= 6:
		return 'YES'
	return 'NO'
t = int(input())
A = [int(s) for s in input().split()]
for i in range(t):
	print(f(A[i]))


import sys
import math
from collections import defaultdict, Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = list(map(int, input().split()))
for j in a:
	if j < 15:
		print('NO')
	else:
		d = j // 7
		if d & 1 or j % 7 == 0:
			print('NO')
		else:
			print('YES')


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)
t = int(input())
x = list(map(int, input().split()))
for i in x:
	cnt = 1
	ans = False
	while True:
		min_total = 21 * cnt - 7 * (cnt - 1) - 6
		max_total = 21 * cnt - 7 * (cnt - 1) - 1
		if min_total <= i <= max_total:
			ans = True
			break
		if i < min_total:
			break
		cnt += max((i - max_total) // 19, 1)
	if ans:
		print('YES')
	else:
		print('NO')


a = int(input())
n = list(map(int, input().split()))
summ = [15, 16, 17, 18, 19, 20]
for i in n:
	if i in summ:
		print('YES')
	elif i <= 14:
		print('NO')
	else:
		i = i % 14
		rem = [1, 2, 3, 4, 5, 6]
		if i in rem:
			print('YES')
		else:
			print('NO')


t = int(input())
request_list = list(map(int, input().split()))
assert t == len(request_list)
for num in request_list:
	if num % 14 in [1, 2, 3, 4, 5, 6] and num > 14:
		print('YES')
	else:
		print('NO')


no_of_testcases = int(input())
number_list = map(int, input().split(' '))
for j in number_list:
	if j < 14:
		print('NO')
		continue
	remainder_from_fourteen = j % 14
	if remainder_from_fourteen >= 1 and remainder_from_fourteen <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in l:
	val = i % 14
	v = i // 14
	if v >= 1:
		if val < 1 or val > 6:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


t = int(input())
a = list(map(int, input().split()))
for i in range(t):
	if a[i] <= 14:
		print('NO')
		continue
	s = a[i] % 14
	if s == 1 or s == 2 or s == 3 or (s == 4) or (s == 5) or (s == 6):
		print('YES')
	else:
		print('NO')


n = int(input())
result = []
for j in [int(i) for i in input().split()]:
	if j <= 14:
		result.append('NO')
	else:
		a = j % 14
		if a >= 1 and a <= 6:
			result.append('YES')
		else:
			result.append('NO')
for i in result:
	print(i)


a = int(input())
list1 = list(map(int, input().split()))
for i in range(a):
	b = list1[i]
	list2 = [15, 16, 17, 18, 19, 20]
	sum = 0
	difference = [b - 15, b - 16, b - 17, b - 18, b - 19, b - 20]
	for i in range(6):
		if difference[i] >= 0:
			if difference[i] % 14 == 0:
				print('YES')
				break
	else:
		print('NO')


n = int(input())
entrada = input().split(' ')
for k in range(n):
	x1 = (int(entrada[k]) - 15) // 14
	if int(entrada[k]) < 15:
		print('NO')
	elif int(entrada[k]) >= x1 * 14 + 15 and int(entrada[k]) <= x1 * 14 + 20:
		print('YES')
	else:
		print('NO')


n = int(input())
inp = input()
inp_arr = list(map(lambda x: int(x), inp.split(' ')))
for i in inp_arr:
	if i >= 20 and (i - 20) % 14 == 0 or (i >= 19 and (i - 19) % 14 == 0) or (i >= 18 and (i - 18) % 14 == 0) or (i >= 17 and (i - 17) % 14 == 0) or (i >= 16 and (i - 16) % 14 == 0) or (i >= 15 and (i - 15) % 14 == 0):
		print('YES')
	else:
		print('NO')


import math
t = int(input())
a = list(map(int, input().split()))
for i in a:
	if i <= 14:
		print('NO')
	elif i % 14 == 0:
		print('NO')
	else:
		k = i % 14
		if k <= 6:
			print('YES')
		else:
			print('NO')


n = int(input())
c = list(map(int, input().split()))
for i in c:
	if i <= 14:
		print('NO')
	elif 14 < i < 21:
		print('YES')
	elif i % 7 != 0 and i // 7 % 2 == 0:
		print('YES')
	else:
		print('NO')


def solve(n):
	if n < 15:
		print('NO')
		return
	q = n // 14 - 1
	n -= 14 * q
	if n >= 15 and n <= 20:
		print('YES')
	else:
		print('NO')
t = input()
d = list(map(int, input().split()))
for i in range(len(d)):
	solve(d[i])


def f(x, suma):
	for i in range(6):
		y = x - suma[i]
		if y % 14 == 0:
			return 1
	return 0
suma = [20, 19, 18, 17, 16, 15]
t = int(input())
arr = list(map(int, input().split()))
for x in arr:
	if x > 14:
		if f(x, suma):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
T = [int(x) for x in input().strip().split()]
print(*['YES' if i > 14 and 0 < i % 14 < 7 else 'NO' for i in T])


t = int(input())
(*x,) = list(map(int, input().split()))
for i in range(len(x)):
	no_die = x[i] // 14
	if no_die > 0:
		x[i] -= (no_die - 1) * 14
	if 15 <= x[i] <= 20:
		print('YES')
	else:
		print('NO')


t = int(input())
li = list(map(int, input().split()))
for n in li:
	if n < 15:
		print('NO')
	elif 0 < n % 14 < 7:
		print('YES')
	else:
		print('NO')


import os
import sys
import bisect
from math import gcd, ceil
from heapq import heapify, heappop, heappush
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split()))
	for x in a:
		if x <= 14:
			print('NO')
			continue
		m = x % 14
		if m >= 1 and m <= 6:
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = lambda s: self.buffer.write(s.encode()) if self.writable else None

	def read(self):
		if self.buffer.tell():
			return self.buffer.read().decode('ascii')
		return os.read(self._fd, os.fstat(self._fd).st_size).decode('ascii')

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline().decode('ascii')

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

def print(*args, sep=' ', end='\n', file=sys.stdout, flush=False):
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(end)
	if flush:
		file.flush()
(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
sys.setrecursionlimit(10000)
main()


n = int(input())
li = list(map(int, input().split()))
for i in li:
	u = i % 14
	if u > 0 and u <= 6 and (i > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
for x in a:
	if 1 <= x % 14 <= 6 and x >= 7:
		print('YES')
	else:
		print('NO')


def task():
	t = int(input())
	l = input().split(' ')
	i = 0
	while i < len(l):
		if int(l[i]) % 14 <= 6 and int(l[i]) > 14 and (int(l[i]) % 14 != 0):
			print('YES')
		else:
			print('NO')
		i += 1
task()


def dicetower(n):
	if n % 14 >= 1 and n % 14 <= 6 and (n > 14):
		return 'YES'
	else:
		return 'NO'
t = input()
list = list(map(int, input().split()))
for i in list:
	print(dicetower(i))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		t = I()
		a = LI()
		for c in a:
			ok = c > 14 and 0 < c % 14 < 7
			rr.append(YES(ok))
	return JA(rr, '\n')
print(main())


import sys
input = sys.stdin.readline
inf = 100000000000000000
mod = 998244353
n = int(input())
A = list(map(int, input().split()))
for a in A:
	if a // 14 >= 1 and a % 14 <= 6 and (a % 14 > 0):
		print('YES')
	else:
		print('NO')


from collections import deque
import sys
input = sys.stdin.buffer.readline
q = int(input())
x = input().split()
iss = list(map(int, x))
for number in iss:
	a7 = number % 14
	if 0 < a7 < 7 and number > 14:
		print('YES')
	else:
		print('NO')


T = int(input())

def process(n):
	r = n % 14
	q = n // 14
	if q >= 1 and r in range(1, 7):
		return 'YES'
	return 'NO'
A = [process(int(i)) for i in input().split()]
for i in A:
	print(i)


input()
l = map(int, input().split())
for el in l:
	if el > 14 and 1 <= el % 14 <= 6:
		print('YES')
	else:
		print('NO')


input()
for x in map(int, input().split()):
	print('NYOE S'[x > 14 and 0 < x % 14 < 7::2])


input()
a = map(int, input().split())
for x in a:
	if x in (1, 2, 3, 4, 5, 6):
		print('NO')
	elif x % 14 in (1, 2, 3, 4, 5, 6):
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
import math
from bisect import bisect_left, bisect_right
input = lambda : stdin.readline().strip()
print = lambda s: stdout.write(s)
n = int(input())
ls = list(map(int, input().split()))
for i in ls:
	n = i // 14
	for j in range(1, 7):
		if 14 * n + j == i and n >= 1:
			print('YES\n')
			break
	else:
		print('NO\n')


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	k = l[i] % 14
	if l[i] // 14 >= 1 and (k > 0 and k < 7):
		print('YES')
	else:
		print('NO')


def main():
	N = int(input())
	T = list(map(int, input().split()))

	def check(t, target):
		vmin = 21 * (t + 1) - 7 * t - 6
		vmax = 21 * (t + 1) - 7 * t - 1
		if target < vmin:
			return (False, True)
		elif vmax < target:
			return (False, False)
		else:
			return (True, True)
	for t in T:
		(lo, hi) = (0, 10 ** 18)
		while hi - lo > 1:
			mid = (hi + lo) // 2
			(fin, nxt) = check(mid, t)
			if fin:
				lo = mid
				break
			if nxt:
				hi = mid
			else:
				lo = mid
		if t in [21 * (lo + 1) - 7 * lo - b for b in [1, 2, 3, 4, 5, 6]]:
			print('YES')
		else:
			print('NO')
main()


x = int(input())
z = map(int, input().strip().split(' '))
for i in z:
	if i >= 15:
		q = i % 14
		if q + 14 >= 15 and q + 14 <= 20:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = input()
for i in map(int, input().split()):
	if i // 14 >= 1 and i % 14 > 0 and (i % 14 < 7):
		print('YES')
	else:
		print('NO')


t = int(input())
lst = [(int(i), int(i) % 14) for i in input().split()]
ans = []
for i in lst:
	if i[0] > 14 and 1 <= i[1] <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
for s in map(int, input().split()):
	possible = False
	for i in range(15, 21):
		if possible:
			break
		x = s - i
		if x == 0:
			possible = True
		elif x > 0:
			if x % 14 == 0:
				possible = True
	print('YES' if possible else 'NO')


t = int(input())
ara = list(map(int, input().strip().split()))
for i in ara:
	if 1 <= i % 14 <= 6 and i > 14:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	r1 = arr[i] // 14
	r2 = arr[i] % 14
	if r1 >= 1 and r2 >= 1 and (r2 < 7):
		print('YES')
	else:
		print('NO')


import sys
import math
import itertools
import collections

def ii():
	return int(input())

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

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
n = ii()
a = li()
for i in range(n):
	if a[i] < 15 or a[i] % 14 > 6 or a[i] % 14 == 0:
		print('NO')
	else:
		print('YES')


def diceTowers(n):
	if n % 14 in (15 % 14, 16 % 14, 17 % 14, 18 % 14, 19 % 14, 20 % 14) and n > 14:
		return 'YES'
	return 'NO'
t = int(input())
arr = list(map(int, input().split()))
for X in arr:
	print(diceTowers(X))


z = input()
y = list(map(int, input().split()))
for x in y:
	for i in range(1, 7):
		if x + i - 7 != 0 and (x + i - 7) % 14 == 0:
			print('YES')
			break
	else:
		print('NO')


n = int(input())
arr = [int(i) for i in input().split()]
for j in range(n):
	if arr[j] // 14 >= 1 and 1 <= arr[j] % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
ar = list(map(int, input().split()))
for i in range(n):
	if 0 < ar[i] % 14 <= 6 and ar[i] > 14:
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().strip().split()))
for i in range(n):
	if a[i] % 7 == 0 or a[i] // 7 % 2 != 0 or a[i] // 7 < 1:
		print('NO')
	else:
		print('YES')


import sys
n = int(sys.stdin.readline())
s = list(map(int, sys.stdin.readline().split()))
for i in range(n):
	x = s[i]
	rem = [1, 2, 3, 4, 5, 6]
	topFace = x % 14
	if x < 14:
		print('NO')
	elif topFace in rem:
		print('YES')
	else:
		print('NO')


t = int(input())
x = input().split()
for i in range(0, len(x)):
	c = int(x[i]) % 14
	if int(x[i]) < 14:
		print('NO')
	elif 0 < c <= 6:
		print('YES')
	else:
		print('NO')


from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
t = int(input())
a = iia()
for i in a:
	if i % 14 <= 6 and i % 14 != 0 and (i > 14):
		print('YES')
	else:
		print('NO')


_ = input()
n = map(int, input().split())
for i in n:
	if i < 15:
		print('NO')
	elif i % 14 in range(1, 7):
		print('YES')
	else:
		print('NO')


from sys import stdin
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
for i in range(n):
	x = s[i]
	if x <= 14:
		print('NO')
		continue
	y = x // 14
	x = x - y * 14
	if x >= 1 and x <= 6:
		print('YES')
	else:
		print('NO')


p = int(input())
l = list(map(int, input().split()))
for i in range(p):
	if l[i] < 15:
		print('NO')
		continue
	if (l[i] - 1) % 14 == 0 or (l[i] - 1) % 14 == 1 or (l[i] - 1) % 14 == 2 or ((l[i] - 1) % 14 == 3) or ((l[i] - 1) % 14 == 4) or ((l[i] - 1) % 14 == 5):
		print('YES')
	else:
		print('NO')


t = int(input())
x = list(map(int, input().rstrip().split()))
for i in x:
	if i < 15:
		print('NO')
	elif i >= 15 and i <= 20:
		print('YES')
	else:
		temp = i // 14
		temp -= 1
		temp = i - temp * 14
		if temp >= 15 and temp <= 20:
			print('YES')
		else:
			print('NO')


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inps():
	return str(input())

def inlt():
	return list(map(int, input().split()))

def inlst():
	return list(map(str, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
arr = inlt()
for i in arr:
	n = i // 14
	if i <= 14:
		print('NO')
	elif i >= int(14 * n + 1) and i <= int(14 * n + 6):
		print('YES')
	else:
		print('NO')


x = int(input())
a = list(map(int, input().split()))
for i in range(0, len(a)):
	if a[i] < 15:
		print('no')
	elif a[i] % 14 in range(1, 7):
		print('yes')
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	if a[i] <= 14:
		print('NO')
		continue
	if 6 >= a[i] % 14 >= 1:
		print('YES')
	else:
		print('NO')


import math
from decimal import Decimal
import heapq
from collections import deque

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def fact(a, b):
	c = []
	ans = 0
	f = int(math.sqrt(a))
	for i in range(1, f + 1):
		if a % i == 0:
			c.append(i)
	l = len(c)
	for i in range(l):
		c.append(a // c[i])
	for i in range(len(c)):
		if c[i] <= b:
			ans += 1
	if a / f == f and b >= f:
		return ans - 1
	return ans
n = int(input())
a = list(map(int, input().split()))
for i in a:
	d = i % 14
	if i <= 6:
		print('NO')
		continue
	if d >= 1 and d <= 6:
		print('YES')
		continue
	print('NO')


import sys
input = sys.stdin.readline
n = int(input())
a = [int(item) for item in input().split()]
for item in a:
	if item <= 14:
		print('NO')
		continue
	if 1 <= item % 14 <= 6:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
t = int(stdin.readline().strip())
xlist = list(map(int, stdin.readline().split()))
for x in xlist:
	k = 14 + x % 14
	if x >= 15 and k >= 15 and (k <= 20):
		stdout.write('YES\n')
	else:
		stdout.write('NO\n')


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	t = ri()
	X = rl()
	for x in X:
		if x < 15:
			print('NO')
		else:
			m = x % 14
			if 1 <= m <= 6:
				print('YES')
			else:
				print('NO')
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


n = input()
for i in list(map(int, input().split())):
	if i < 15:
		print('NO')
		continue
	x = i % 14 + 14
	if x >= 15 and x < 21:
		print('YES')
	else:
		print('NO')


n = int(input())
ls_x = list(map(int, input().split()))
for i in range(n):
	if ls_x[i] < 15:
		print('NO')
	elif 1 <= ls_x[i] % 14 <= 6:
		print('YES')
	else:
		print('NO')


input()
for x in input().split():
	if int(x) > 14 and 1 <= int(x) % 14 < 7:
		print('YES')
	else:
		print('NO')


t = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
	if l[i] < 15:
		print('NO')
	elif l[i] % 14 == 1 or l[i] % 14 == 2 or l[i] % 14 == 3 or (l[i] % 14 == 4) or (l[i] % 14 == 5) or (l[i] % 14 == 6):
		print('YES')
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
s = [i for i in range(15, 21)]
for i in a:
	flag = 0
	for t in s:
		if i >= t and (i - t) % 14 == 0:
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	n = int(input())
	a = list(map(int, sys.stdin.readline().split(' ')))
	for num in a:
		if num <= 14:
			print('NO')
			continue
		num = num % 14
		if num >= 1 and num <= 6:
			print('YES')
		else:
			print('NO')
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


n = int(input())
b = list(map(int, input().split()))
i = 0
while i < n:
	temp = b[i]
	count = 0
	for j in range(1, 7):
		te = temp - j
		if te % 14 == 0 and te > 0:
			count = 1
			print('yes')
			break
	if count == 0:
		print('no')
	i += 1


n = int(input())
l = list(map(int, input().split()))
for o in l:
	if o <= 14:
		print('NO')
	elif o < 21:
		print('YES')
	else:
		u = True
		for i in range(15, 21):
			if (o - i) % 14 == 0:
				print('YES')
				u = False
				break
		if u:
			print('NO')


from collections import deque
from math import ceil, floor, sqrt, gcd

def ii():
	return int(input())

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

def li():
	return list(mi())

def si():
	return input()
t = ii()
a = li()
for i in a:
	k = i % 14
	if i < 15:
		print('NO')
	elif k >= 1 and k <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in map(int, input().split()):
	print('YNEOS'[not 0 < i % 14 < 7 < i::2])


n = int(input())
numlist = input().split()
for i in numlist:
	temp = int(i) % 14
	if temp > 0 and temp < 7 and (int(i) > 14):
		print('Yes')
	else:
		print('No')


n = int(input())
arr = [int(i) for i in input().split()]
for num in arr:
	if num % 14 in (1, 2, 3, 4, 5, 6) and num // 14 > 0:
		print('YES')
	else:
		print('NO')


input()
for x in map(int, input().split()):
	print('NYOE S'[14 < x - max(0, (x // 14 - 1) * 14) < 21::2])


def Input():
	tem = input().split()
	ans = []
	for it in tem:
		ans.append(int(it))
	return ans
n = Input()[0]
a = Input()
for i in range(n):
	k = a[i] % 14
	if a[i] > 14 and k >= 1 and (k <= 6):
		print('YES')
	else:
		print('NO')


def is_possible(num):
	return num > 7 and any(map(lambda x: not (num - x) % 14, range(1, 7)))
input()
for x in map(is_possible, map(int, input().split())):
	print('YES' if x else 'NO')


from math import ceil
n = int(input())
X = list(map(int, input().split()))
for x in X:
	res = 'NO'
	for t in range(1, 7):
		if (x - t) % 14 == 0 and (x - t) // 14 >= 1:
			res = 'YES'
			break
	print(res)


q = int(input())
w = list(map(int, input().split()))
for i in w:
	if i % 14 >= 1 and i % 14 <= 6 and (i > 14):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
X = list(map(int, input().split()))
for x in X:
	if x <= 14:
		print('NO')
	elif 1 <= x % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
num = [int(p) for p in input().split()]
for j in range(len(num)):
	if num[j] > 14:
		for i in range(20, 14, -1):
			temp = num[j] - i
			if temp % 14 == 0:
				print('YES')
				break
			elif i == 15:
				print('NO')
	else:
		print('NO')


n = int(input())
arr = [int(i) for i in input().split()]
for i in arr:
	if i % 14 <= 6 and i > 14 and (i % 14 > 0):
		print('YES')
	else:
		print('NO')


input()

def f(s):
	s = int(s)
	return ['NO', 'YES'][s >= 14 and s % 14 in range(1, 7)]
print(*map(f, input().split()))


n = int(input())
l = list(map(int, input().split()))
for k in l:
	if k >= 15 and 0 < k % 14 <= 6:
		print('YES')
	else:
		print('NO')


n = int(input())
li = list(map(int, input().split()))
for i in li:
	tmp = i % 14
	dc = i // 14
	if 6 >= tmp >= 1 and dc >= 1:
		print('YES')
	else:
		print('NO')


n = int(input())
k = input().split()
for i in range(n):
	if int(k[i]) < 15:
		print('NO')
	elif int(k[i]) % 14 < 7 and int(k[i]) % 14 != 0:
		print('YES')
	else:
		print('NO')


n = int(input())
arr = input().split(' ')
for i in range(len(arr)):
	num = int(arr[i])
	if num <= 14:
		print('NO')
		continue
	if num % 14 < 7 and num % 14 != 0:
		print('YES')
	else:
		print('NO')


n = input()
arr = map(int, input().split())
for y in arr:
	if y > 14:
		x = y
		z = x // 14
		x = x - z * 14
		if x < 15:
			x = x + 14
		if x >= 15 and x < 21:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


n = int(input())
arr = [int(x) for x in input().split()]
for x in arr:
	f = False
	if x < 15:
		print('NO')
		continue
	for p in range(15, 20 + 1):
		if (x - p) % 14 == 0:
			f = True
			break
	print(['NO', 'YES'][int(f)])


def main():
	N = int(input())
	arr = list(map(int, input().split()))
	for n in arr:
		if n <= 14:
			print('NO')
			continue
		x = n // 14
		y = n - 14 * x
		if 1 <= y <= 6:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
x = list(map(int, input().split()))
for y in x:
	if y // 7 <= 1 or y % 7 == 0 or y // 7 % 2 == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
a = list(map(int, input().split()))
for n in a:
	if n < 15:
		print('NO')
		continue
	m = n % 14
	if m > 0 and m <= 6:
		print('YES')
	else:
		print('NO')


n = input()
l = list(map(int, input().split()))
for x in l:
	if x < 15:
		print('NO')
		continue
	print('YES' if x % 14 >= 1 and x % 14 <= 6 else 'NO')


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
t = oint()
xx = list(rint())
for x in xx:
	a = x - 7
	for i in range(1, 6 + 1):
		aa = a + i
		if aa % 14 == 0 and aa // 14 >= 1:
			print('YES')
			break
	else:
		print('NO')


a = int(input())
b = list(map(int, input().split()))
for i in b:
	if i % 14 != 0 and i % 14 < 7 and (i > 13):
		print('YES')
	else:
		print('NO')


from __future__ import division, print_function

def main():
	import sys
	data = iter(map(int, sys.stdin.buffer.read().decode('ascii').split()))
	n = int(next(data))
	res = [None] * n
	for i in range(n):
		x = next(data)
		r = x % 14
		if x <= 14:
			res[i] = 'NO'
		elif 1 <= r <= 6:
			res[i] = 'YES'
		else:
			res[i] = 'NO'
	sys.stdout.buffer.write('\n'.join((str(x) for x in res)).encode('ascii'))
	return 0
main()


def check(x):
	if 1 <= x % 14 <= 6 and x // 14 >= 1:
		return 'YES'
	return 'NO'
n = int(input())
lst = [int(i) for i in input().split()]
print(*[check(elem) for elem in lst], sep='\n')


from math import floor, ceil
t = int(input())
a = list(map(int, input().split()))
for n in a:
	if n <= 14:
		print('NO')
	elif n % 14 in [1, 2, 3, 4, 5, 6]:
		print('YES')
	else:
		print('NO')


N = int(input())
X = list(map(int, input().split()))
for i in range(N):
	X[i] -= 14 * max(0, X[i] // 14 - 1)
	print('YES' if X[i] in range(15, 21) else 'NO')


import sys
input = sys.stdin.readline
from bisect import *

def linput(tt=int):
	return list(map(tt, input().split()))

def gcd(a: int, b: int):
	while b:
		(a, b) = (b, a % b)
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def main():
	Q = int(input())
	vA = linput()
	vR = []
	for A in vA:
		R = 0 < A % 14 < 7
		R = R and 14 < A
		vR.append(R)
	sT = 'NO YES'.split()
	for r in vR:
		print(sT[r])
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for j in range(int(input())):
	vals = list(map(int, input().split()))
	a1 = set([20, 19, 18, 17, 16, 15])
	for s in range(len(vals)):
		f = False
		for b in a1:
			if (vals[s] - b) % 14 == 0 and vals[s] > 14 or vals[s] in a1:
				f = True
				break
		if f == True:
			print('YES')
		else:
			print('NO')


from sys import stdin
import sys
sys.setrecursionlimit(2 * 10 ** 5)
import math
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
for i in range(n):
	k = arr[i] // 14
	if k > 0 and arr[i] <= k * 14 + 6 and (k * 14 + 1 <= arr[i]):
		print('YES')
	else:
		print('NO')


t = int(input())
arr = list(map(int, input().split()))
for i in range(t):
	val = arr[i] - 14 * (arr[i] // 14)
	if arr[i] >= 15 and val > 0 and (val <= 6):
		print('YES')
	else:
		print('NO')


def solution(t):
	arr = map(int, input().split())
	for ele in arr:
		if ele <= 14:
			print('NO')
		else:
			rem = ele % 14
			if rem > 0 and rem <= 6:
				print('YES')
			else:
				print('NO')

def main():
	t = int(input())
	solution(t)
main()


import math, time
start_time = time.time()

def check_stacks(num):
	add = 0
	if num % 14 > 6:
		add = 1
	return math.floor(num / 14) + add

def dice_algorithm(desire):
	if desire in range(1, 15):
		print('NO')
	elif desire % 14 in range(1, 7):
		print('YES')
	else:
		print('NO')
sets = input()
fav_ints = [x for x in input().split()]
for y in fav_ints:
	dice_algorithm(int(y))


n = int(input())
t = input().split(' ')
for i in range(n):
	num = int(t[i])
	if num <= 14:
		print('NO')
	elif num % 14 <= 6 and num % 14 > 0:
		print('YES')
	else:
		print('NO')


res = []
input()
for x in map(int, input().split()):
	valid = False
	for a in range(1, 7):
		c = x - 21 + a
		if c < 0 or c % 14 != 0:
			continue
		valid = True
	res.append(['NO', 'YES'][valid])
print(*res, sep='\n')


import math
n = int(input())
nums = [int(x) for x in input().split()]
for x in nums:
	rem = x % 14
	divide = math.floor(x / 14)
	if rem <= 6 and rem >= 1 and (divide >= 1):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
for a in A:
	print('YES' if a // 14 > 0 and 1 <= a % 14 <= 6 else 'NO')


t = int(input())
x = input()
xx = x.split()
s = []
for i in xx:
	if int(i) < 15:
		s.append('NO')
	else:
		d = int(i) % 14
		if 0 < d <= 6:
			s.append('YES')
		else:
			s.append('NO')
for i in s:
	print(i)


n = int(input())
data = list(map(int, input().split()))
for t in data:
	if t < 15:
		print('NO')
		continue
	t = t - t // 14 * 14
	if t >= 1 and t <= 6:
		print('YES')
	else:
		print('NO')


t = int(input())
arr = list(map(int, input().split()))
for i in range(t):
	k = arr[i]
	if k % 14 > 6 or k % 14 == 0 or k < 15:
		print('NO')
	else:
		print('YES')


l = [20, 19, 18, 17, 16, 15]

def isvalid(n):
	for i in l:
		if n >= i and (n - i) % 14 == 0:
			return 1
	return 0
n = int(input())
lo = input().split()
li = [int(i) for i in lo]
for i in li:
	if isvalid(i):
		print('YES')
	else:
		print('NO')


n = int(input())
numere = input().split()
for i in numere:
	x = int(i)
	rest = x % 14
	if (rest == 1 or rest == 2 or rest == 3 or (rest == 4) or (rest == 5) or (rest == 6)) and x > 14:
		print('YES')
	else:
		print('NO')


n = int(input())
s = input().split()
for i in s:
	if int(i) < 15:
		print('NO')
	else:
		q = int(i) % 14
		if 0 < q < 7:
			print('YES')
		else:
			print('NO')


n = input()
a = map(int, input().split())
for k in a:
	if k % 14 < 7 and k % 14 != 0 and (k > 14):
		print('YES')
	else:
		print('NO')


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	d = l[i] // 14
	t = l[i] % 14
	if d >= 1 and 1 <= t < 7:
		print('YES')
	else:
		print('NO')


a = int(input())
b = map(int, input().split())
for i in b:
	t = 0
	for j in range(1, 7):
		if (i - j) % 14 == 0:
			t = 1
	if t == 0 or i < 15:
		print('NO')
	else:
		print('YES')


n = int(input())
s = list(map(int, input().split()))
for item in s:
	if item <= 14:
		print('NO')
	elif item % 14 <= 6 and item % 14 >= 1:
		print('YES')
	else:
		print('NO')


n = int(input())
x = list(map(int, input().split()))
for i in range(n):
	flag = False
	for j in range(1, 6 + 1):
		if (x[i] - j) % 14 == 0 and x[i] >= 15:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')


import sys
import math
import re
import io

def solve2(n, k):
	n += k
	if n >= 21 and (n - 21) % 14 == 0:
		return True
	return False

def solve(n):
	for i in range(1, 7):
		if solve2(n, i):
			return True
	return False

def main():
	n = int(input())
	A = list(map(int, input().split()))
	for a in A:
		if solve(a):
			print('YES')
		else:
			print('NO')
main()


t = int(input())
l = list(map(int, input().split()))
for i in range(t):
	if l[i] // 14:
		rem = l[i] % 14
		if 1 <= rem <= 6:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


T = int(input())
A = [int(x) for x in input().split()]
for x in A:
	if x < 15:
		print('NO')
	else:
		print('YES' if 0 < x % 14 < 7 else 'NO')


t = int(input())
s = list(input().split())
answer = []
for i in range(t):
	k = int(s[i])
	n = k // 14
	if k - n * 14 > 6 or k - n * 14 == 0 or k < 15:
		answer.append('NO')
	else:
		answer.append('YES')
for i in answer:
	print(i)