AtCoder Beginner Contest 105 - Cakes and Donuts

La Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.
Determine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.

-----Constraints-----
 - N is an integer between 1 and 100, inclusive.

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
If there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.

-----Sample Input-----
11

-----Sample Output-----
Yes

If you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.

Source: atcoder | Difficulty: EASY


Solutions:
print('Yes' if [4 * i + 7 * j for i in range(26) for j in range(16)].count(int(input())) else 'No')


print('Yes' if [4 * i + 7 * j for i in range(26) for j in range(15)].count(int(input())) > 0 else 'No')


n = int(input())
print('Yes' if n in [4 * i + 7 * j for i in range(26) for j in range(15)] else 'No')


N = int(input())
a = [4 * x + 7 * y for x in range(200) for y in range(200)]
ans = 'Yes' if N in a else 'No'
print(ans)


n = int(input())
if n in [1, 2, 3, 5, 6, 9, 10, 13, 17]:
	print('No')
else:
	print('Yes')


N = int(input())
if N < 4:
	print('No')
	return
for i in range(N // 4 + 1):
	if (N - 4 * i) % 7 == 0:
		print('Yes')
		return
print('No')


N = int(input())
for a in range(N // 4 + 1):
	for b in range(N // 7 + 1):
		if 4 * a + 7 * b == N:
			print('Yes')
			return
print('No')


n = int(input())
ans = 'No'
for i in range(15):
	a = n - i * 7
	if a >= 0 and a % 4 == 0:
		ans = 'Yes'
print(ans)


n = int(input())
if n < 4:
	print('No')
elif n in {5, 6, 9, 10, 13, 17, 23}:
	print('No')
else:
	print('Yes')


n = int(input())
for i in range(n):
	for j in range(n):
		if i * 4 + j * 7 == n:
			print('Yes')
			return
print('No')


n = int(input())
print('Yes' if [4 * a + 7 * b for a in range(n) for b in range(n)].count(n) != 0 else 'No')


N = int(input())
ans = 'No'
for i in range(N + 1):
	if i % 4 == 0 and (N - i) % 7 == 0:
		ans = 'Yes'
print(ans)


n = int(input())
ans = 'No'
for i in range(n // 4 + 1):
	for j in range(n // 7 + 1):
		if n == 4 * i + 7 * j:
			ans = 'Yes'
			break
print(ans)


n = int(input())
while n >= 0:
	if n % 7 == 0:
		print('Yes')
		exit()
	n -= 4
print('No')


N = int(input())
L = [4 * x + 7 * y for x in range(26) for y in range(15)]
print('Yes' if N in L else 'No')


print('Yes' if [4 * i + 7 * j for i in range(101) for j in range(101)].count(int(input())) else 'No')


n = int(input())
for i in range(n // 7 + 1):
	if (n - i * 7) % 4 == 0:
		print('Yes')
		exit()
print('No')


N = int(input())
out = 'No'
for x in range(N // 4 + 1):
	for y in range(N // 7 + 1):
		if 4 * x + 7 * y == N:
			out = 'Yes'
			break
print(out)


c = [1, 2, 3, 5, 6, 9, 10, 13, 17, 23, 27]
N = int(input())
print('No' if N % 28 in c else 'Yes')


n = int(input())
ls = [4 * i + 7 * j for i in range(n) for j in range(n)]
print('Yes' if n in ls else 'No')


N = int(input())
ans = 'No'
i = 0
while 7 * i <= N:
	if (N - 7 * i) % 4 == 0:
		ans = 'Yes'
	i += 1
print(ans)


N = int(input())
cake = [1, 2, 3, 5, 6, 9, 10, 13, 17]
if cake.count(N) == 0:
	print('Yes')
else:
	print('No')


N = int(input())
a = 'No'
for i in range(14):
	if N < 0:
		break
	if N % 4 == 0:
		a = 'Yes'
		break
	N -= 7
print(a)


n = int(input())
if n >= 18:
	print('Yes')
elif n % 4 == 0 or n % 7 == 0:
	print('Yes')
elif n - 7 >= 0 and (n - 7) % 4 == 0:
	print('Yes')
else:
	print('No')


N = int(input())
d = N // 4
for i in range(d + 1):
	if (N - 4 * i) % 7 == 0:
		print('Yes')
		break
else:
	print('No')


N = int(input())
M = [4 * i + 7 * j for i in range(100) for j in range(100)]
if N in M:
	print('Yes')
else:
	print('No')


x = int(input())
t = 0
while x >= 0:
	if x % 7 == 0:
		t = 1
	x -= 4
if t == 0:
	print('No')
else:
	print('Yes')


def main():
	N = int(input())
	for f in range(N // 4 + 1):
		for s in range(N // 7 + 1):
			if 4 * f + 7 * s == N:
				print('Yes')
				return
	print('No')
main()


N = int(input())
print('Yes' if [4 * x + 7 * y for x in range(N) for y in range(N)].count(N) > 0 else 'No')


N = int(input())
ans = 'No'
for i in range(15):
	for j in range(26):
		if i * 7 + j * 4 == N:
			ans = 'Yes'
		else:
			pass
print(ans)


n = int(input())
f = 0
while n >= 0:
	if n % 7 < 1:
		f += 1
	n -= 4
print('Yes' if f > 0 else 'No')


n = int(input())
if n % 4 == 0:
	print('Yes')
elif n >= 28 - 7 * (n % 4):
	print('Yes')
else:
	print('No')


N = int(input())
for i in range(0, N // 4 + 2, 1):
	if (N - i * 4) % 7 == 0:
		print('Yes')
		exit()
print('No')


n = int(input())
s = 'No'
for i in range(n):
	for j in range(n):
		if 4 * i + 7 * j == n:
			s = 'Yes'
			break
print(s)


n = int(input())
print('Yes' if [a * 4 + b * 7 for a in range(26) for b in range(16)].count(n) else 'No')


a = [0]
for i in range(101):
	if i in a:
		a += [i + 4, i + 7]
n = int(input())
print('Yes' if n in a else 'No')


n = int(input())
print('Yes' if n in [7, 14, 4, 11, 8, 15, 12, 16] or n > 17 else 'No')


n = int(input())
ans = 'No'
while 0 < n:
	if n % 7 == 0 or n % 4 == 0 or n % 11 == 0:
		ans = 'Yes'
		break
	n -= 4
print(ans)


N = int(input())
res = 'No'
for i in range(25):
	for j in range(14):
		if i * 4 + j * 7 == N:
			res = 'Yes'
print(res)


n = int(input())
print('Yes' if [1 for a in range(n // 7 + 1) for b in range(n // 4 + 1) if a * 7 + b * 4 == n] else 'No')


a = int(input())
sm = [4 * i + 7 * j for j in range(14) for i in range(26)].count(a)
print('Yes' if sm > 0 else 'No')


a = int(input())
b = 0
for i in range(26):
	for h in range(15):
		if i * 4 + h * 7 == a:
			b = b + 1
if b == 0:
	print('No')
else:
	print('Yes')


n = int(input())
for i in range(26):
	ans = 0
	ans += 4 * i
	for j in range(15):
		ans += 7 * j
		if ans == n:
			print('Yes')
			return
print('No')


n = int(input())
res = 'No'
if n % 4 == 0:
	res = 'Yes'
while n > 0:
	if n % 7 == 0:
		res = 'Yes'
		break
	n -= 4
print(res)


print('Yes' if [4 * x + 7 * y for y in range(25) for x in range(15)].count(int(input())) else 'No')


def main():
	n = int(input())
	cakes = range(n // 4 + 1)
	donuts = range(n // 7 + 1)
	for i in cakes:
		for j in donuts:
			if 4 * i + 7 * j == n:
				print('Yes')
				return
	print('No')
main()


a = int(input())
print('Yes' if [4 * x + 7 * y for x in range(101) for y in range(101)].count(a) else 'No')


n = int(input())
if n >= 28:
	print('Yes')
else:
	ans = 'No'
	for i in range(8):
		for j in range(5):
			if i * 4 + j * 7 == n:
				ans = 'Yes'
	print(ans)


n = int(input())
(i, ans) = (0, 'No')
while 7 * i <= n:
	if (n - 7 * i) % 4 == 0:
		ans = 'Yes'
		break
	i += 1
print(ans)


n = int(input())
ans = 'No'
while n >= 0:
	if n % 4 == 0:
		ans = 'Yes'
		break
	else:
		n -= 7
print(ans)


N = int(input())
while N >= 0:
	if N % 4 == 0:
		print('Yes')
		exit()
	N -= 7
print('No')


N = int(input())
for i in range(26):
	for j in range(15):
		if i * 4 + j * 7 == N:
			print('Yes')
			return
print('No')


n = int(input())
ans = 'No'
for i in range(26):
	for j in range(20):
		if i * 4 + j * 7 == n:
			ans = 'Yes'
print(ans)


N = int(input())
cnt = 0
for i in range(N // 4 + 1):
	for j in range(N // 7 + 1):
		if 4 * i + 7 * j == N:
			cnt += 1
if cnt > 0:
	print('Yes')
else:
	print('No')


n = int(input())
flg = False
for i in range(n // 4 + 1):
	for j in range(n // 7 + 1):
		if i * 4 + j * 7 == n:
			flg = True
			break
if flg:
	print('Yes')
else:
	print('No')


x = int(input())
print('No' if x < 4 or 4 < x < 7 or 8 < x < 11 or (x == 13) or (x == 17) else 'Yes')


n = int(input())

def f():
	for i in range(100):
		for j in range(100):
			if 4 * i + 7 * j == n:
				return 'Yes'
	return 'No'
print(f())


n = int(input())
for i in range(0, n + 1, 4):
	j = n - i
	if j >= 0 and j % 7 == 0:
		print('Yes')
		break
else:
	print('No')


N = int(input())
print('Yes' if len(['yes' for i in range(26) for j in range(15) if 4 * i + 7 * j == N]) > 0 else 'No')


N = int(input())
for c4 in range(26):
	for c7 in range(16):
		c = 4 * c4 + 7 * c7
		if c == N:
			print('Yes')
			return
print('No')


n = int(input())
l = [4 * x + 7 * y for x in range(26) for y in range(16)].count(n)
print('Yes' if l != 0 else 'No')


N = int(input())
while N >= 4 or N == 0:
	if N % 7 == 0:
		print('Yes')
		break
	else:
		N -= 4
else:
	print('No')


n = int(input())
p = n // 7
print('YNeos'[not any([(n - k * 7) % 4 == 0 for k in range(p + 1)])::2])


def answer(n: int) -> str:
	for i in range(n // 4 + 1):
		for j in range(n // 7 + 1):
			if n == i * 4 + j * 7:
				return 'Yes'
	return 'No'

def main():
	n = int(input())
	print(answer(n))

def __starting_point():
	main()
__starting_point()


N = int(input())
flag = 0
if N % 4 == 0 or N % 7 == 0:
	flag = 1
else:
	out = N // 7
	for i in range(out):
		if (N - 7 * (i + 1)) % 4 == 0:
			flag = 1
			break
if flag == 1:
	print('Yes')
else:
	print('No')


import sys
N = int(sys.stdin.readline().rstrip())
A = [1, 2, 3, 5, 6, 9, 10, 13, 17]
print('No' if N in A else 'Yes')


n = int(input())
z = 'No'
for i in range(n // 4 + 1):
	if (n - 4 * i) % 7 == 0:
		z = 'Yes'
		break
print(z)


N = int(input())
L = [1, 2, 3, 5, 6, 9, 10, 13, 17]
for i in L:
	if i == N:
		print('No')
		exit()
print('Yes')


N = int(input())
for n4 in range(N // 4 + 1):
	if (N - n4 * 4) % 7 == 0:
		print('Yes')
		exit()
print('No')


print('YNeos'[int(input()) in [1, 2, 3, 5, 6, 9, 10, 13, 17]::2])


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

def I():
	return int(input())

def F():
	return float(input())

def SS():
	return input()

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

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

def LF():
	return [float(x) for x in input().split()]

def LSS():
	return input().split()

def resolve():
	N = I()
	is_ok = False
	for i in range(N // 7 + 1):
		if (N - 7 * i) % 4 == 0:
			is_ok = True
	if is_ok:
		print('Yes')
	else:
		print('No')

def __starting_point():
	resolve()
__starting_point()


N = int(input())
if N % 2:
	N -= 7
if N % 4:
	N -= 14
if N >= 0:
	print('Yes')
else:
	print('No')


N = int(input())
for i in range(30):
	for j in range(20):
		if i * 4 + j * 7 == N:
			print('Yes')
			exit()
print('No')


a = int(input())
b = [1, 2, 3, 5, 6, 9, 10, 13, 17]
print('Yes' if a % 28 not in b or a > 27 else 'No')


def readinput():
	n = int(input())
	return n

def main(n):
	for k in range(n // 4 + 1):
		if (n - 4 * k) % 7 == 0:
			return 'Yes'
	else:
		return 'No'

def __starting_point():
	n = readinput()
	ans = main(n)
	print(ans)
__starting_point()


n = int(input())
flag = 'No'
for i in range(0, n // 4 + 2):
	for j in range(0, n // 7 + 2):
		if 4 * i + 7 * j == n:
			flag = 'Yes'
print(flag)


import sys
n = int(input())
for i in range(int(n / 4) + 1):
	for j in range(int(n / 7) + 1):
		if 4 * i + 7 * j == n:
			print('Yes')
			return
print('No')


N = int(input())
cake = 4
donuts = 7
ans = 'No'
for i in range(N // donuts + 1):
	reminder = N - i * donuts
	if reminder % cake == 0 or reminder == 0:
		ans = 'Yes'
		break
print(ans)


N = int(input())
a = N // 7
AA = [(N - 7 * i) % 4 for i in range(a + 1)]
if 0 in AA:
	print('Yes')
else:
	print('No')


N = int(input())
for i in range(26):
	if (N - i * 4) % 7 == 0 and N >= i * 4:
		print('Yes')
		exit()
print('No')


N = int(input())
for i in range(25):
	for j in range(15):
		if i * 4 + j * 7 == N:
			print('Yes')
			return
else:
	print('No')


n = int(input())
X = n // 4 + 1
for x in range(X):
	if (n - 4 * x) % 7 == 0:
		print('Yes')
		exit()
print('No')


N = int(input())
ans = False
for i in range(N // 4 + 1):
	for j in range(N // 7 + 1):
		if 4 * i + 7 * j == N:
			ans = True
			break
if ans == True:
	print('Yes')
else:
	print('No')


N = int(input())

def rec(n):
	if n < 0:
		return False
	if n % 4 == 0 or n % 7 == 0:
		return True
	else:
		return rec(n - 4)
if rec(N):
	print('Yes')
else:
	print('No')


n = int(input())
print('Yes' if len([1 for i in range(26) if (n - 4 * i) % 7 == 0 and n - 4 * i >= 0]) > 0 else 'No')


n = int(input())
if n % 7 == 3 or n in (1, 2, 5, 6, 9, 13):
	print('No')
else:
	print('Yes')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

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

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 main():
	N = I()
	for i in range(30):
		nokori = N - 7 * i
		if nokori >= 0 and nokori % 4 == 0:
			print('Yes')
			return
	print('No')
	return
main()


r = range
l = [4 * i + 7 * j for i in r(26) for j in r(15)]
print('NYoe s'[int(input()) in l::2])


n = int(input())
ans = 0
for i in range(100):
	if n - 4 * i >= 0 and (n - 4 * i) % 7 == 0:
		ans += 1
if ans >= 1:
	print('Yes')
else:
	print('No')


N = int(input())
check = False
for i in range(26):
	for j in range(15):
		if N == 4 * i + 7 * j:
			check = True
print('Yes' if check else 'No')


n = int(input())
print('Yes' if len([1 for i in range(n // 4 + 1) for j in range(n // 7 + 1) if 4 * i + 7 * j == n]) >= 1 else 'No')


n = int(input())
cnt = 0
for i in range(26):
	for j in range(15):
		if i * 4 + j * 7 == n:
			cnt += 1
		else:
			continue
if cnt != 0:
	print('Yes')
else:
	print('No')


n = int(input())
x = 100 // 7 + 2
for i in range(x):
	for j in range(x):
		if 4 * i + 7 * j == n:
			print('Yes')
			break
	else:
		continue
	break
else:
	print('No')


n = int(input())
a = int(n / 7)
check = False
for i in range(a, -1, -1):
	if (n - 7 * i) % 4 == 0:
		check = True
if check:
	print('Yes')
else:
	print('No')


s = int(input())
while s >= 0:
	if s % 7 == 0:
		print('Yes')
		break
	s -= 4
if s < 0:
	print('No')


A = int(input())
while A >= 0:
	if A % 7 == 0:
		print('Yes')
		exit(0)
	A -= 4
print('No')


N = int(input())
for i in range(int(N / 4) + 1):
	for j in range(int(N / 7) + 1):
		total = 4 * i + 7 * j
		if total == N:
			print('Yes')
			return
else:
	print('No')


N = int(input())
c = 0
for i in range(25):
	for j in range(14):
		if i * 4 + j * 7 == N:
			print('Yes')
			c += 1
			return
		else:
			pass
if c == 0:
	print('No')
else:
	pass


n = int(input())
for i in range(n):
	j = 0
	while 4 * i + 7 * j <= 100:
		if 4 * i + 7 * j == n:
			print('Yes')
			return
		else:
			j += 1
print('No')


n = int(input())
cnt = 0
for i in range(30):
	for j in range(20):
		price = 4 * i + 7 * j
		if price == n:
			cnt += 1
if cnt == 0:
	print('No')
else:
	print('Yes')


n = int(input())
print('YNeos'[n < -n % 4 * 7::2])


N = int(input())
max_4 = 25
max_7 = 14
answer = 'No'
for i in range(max_4 + 1):
	for j in range(max_7 + 1):
		sum = 4 * i + j * 7
		if sum == N:
			answer = 'Yes'
			break
	if answer == 'Yes':
		break
print(answer)


ans = int(input())
loopFlg = True
for i in range(26):
	if loopFlg == False:
		break
	for j in range(15):
		if 4 * i + 7 * j == ans:
			loopFlg = False
if loopFlg == True:
	print('No')
else:
	print('Yes')


N = int(input())
for i in range(0, 4):
	if N - 7 * i >= 0 and (N - 7 * i) % 4 == 0:
		print('Yes')
		break
else:
	print('No')


N = int(input())
cake = 4
donatu = 7
jage = 'No'
for d in range(15):
	for c in range(26):
		if cake * c + donatu * d == N:
			jage = 'Yes'
print(jage)


n = int(input())
print('Yes' if n >= 7 * (-n % 4) else 'No')


N = int(input())
ans = 'No'
while N >= 0:
	if N % 4 == 0 or N % 7 == 0:
		ans = 'Yes'
	N -= 11
print(ans)


n = int(input())
if 4 * (2 * n // 7) - n >= 0:
	print('Yes')
else:
	print('No')


n = int(input())
apple = [4 * i + 7 * j for i in range(100) for j in range(100)]
print('Yes' if n in apple else 'No')


N = int(input())
ans = 'No'
for i in range(N // 4 + 1):
	for j in range(N // 7 + 1):
		if 4 * i + 7 * j == N:
			ans = 'Yes'
print(ans)


n = int(input())
b = []
for i in range(15):
	for j in range(12):
		b.append(i * 4 + j * 7)
print('NYoe s'[n in b::2])


n = int(input())
if n <= 3 or n == 5 or n == 6 or (n == 9) or (n == 10) or (n == 13) or (n == 17):
	print('No')
else:
	print('Yes')


N = int(input())
ans = 'No'
if N % 4 == 0:
	ans = 'Yes'
for i in range(15):
	N = N - 7
	if N < 0:
		break
	if N % 4 == 0:
		ans = 'Yes'
print(ans)


N = int(input())
print('Yes' if any((N - 4 * a >= 0 and (N - 4 * a) % 7 == 0 for a in range(100))) else 'No')


n = int(input())
f = n // 4
s = n // 7
flag = False
for i in range(f + 1):
	for j in range(s + 1):
		total = i * 4 + j * 7
		if total == n:
			flag = True
			break
if flag:
	print('Yes')
else:
	print('No')


n = int(input())
for i in range(0, n):
	if n % 4 == 0:
		print('Yes')
		return
	else:
		n -= 7
		if n < 0:
			break
for i in range(0, n):
	if n % 7 == 0:
		print('Yes')
		return
	else:
		n -= 4
		if n < 0:
			break
print('No')


N = int(input())
for i in range(30):
	for j in range(30):
		if 4 * i + 7 * j == N:
			print('Yes')
			return
print('No')


n = int(input())
a = int(n / 7)
for i in range(a, -1, -1):
	if (n - 7 * i) % 4 == 0:
		print('Yes')
		return
print('No')


n = int(input())
print('Yes' if any(((n - 4 * i) % 7 == 0 for i in range(n // 4 + 1))) else 'No')


n = int(input())
p = -4
g = 'No'
while p <= n:
	p += 4
	if (n - p) % 7 == 0:
		g = 'Yes'
		break
print(g)


N = int(input())
for cake in range(N):
	for dornat in range(N):
		if 4 * cake + 7 * dornat == N:
			print('Yes')
			return
print('No')


print('YNeos'[140910 >> int(input()) & 1::2])


n = int(input())
s = 'No'
for i in range(26):
	for j in range(16):
		total = 4 * i + 7 * j
		if total == n:
			s = 'Yes'
			break
	if total == n:
		break
print(s)


n = int(input())
frag = 'No'
for i in range(n // 4 + 2):
	if (n - 4 * i) % 7 == 0:
		frag = 'Yes'
		break
print(frag)


N = int(input())
print('YNeos'[N not in [a + b for a in range(0, N + 1, 4) for b in range(0, N + 1, 7)]::2])


N = int(input())
if N >= 18 or N in [4, 7, 8, 11, 12, 14, 15, 16]:
	print('Yes')
else:
	print('No')


N = int(input())
M = [4 * i + 7 * j for i in range(30) for j in range(20)]
if N in M:
	print('Yes')
else:
	print('No')


n = int(input())
for i in range(26):
	for j in range(16):
		if i * 4 + 7 * j == n:
			print('Yes')
			exit()
print('No')


l = [x * 4 + y * 7 for x in range(100) for y in range(100)]
n = int(input())
ans = 'Yes' if n in l else 'No'
print(ans)


N = int(input())
NG = [1, 2, 3, 5, 6, 9, 10, 13, 17]
print('Yes' if N not in NG else 'No')


a = [0, 4, 7, 8, 11, 12, 15, 16, 18, 19, 20, 22, 23, 24, 25, 26, 27]
b = int(input())
b %= 28
print(['No', 'Yes'][b in a])


N = int(input())
s = 'No'
for i in range(0, N + 1, 7):
	if (N - i) % 4 == 0:
		s = 'Yes'
		break
print(s)


n = int(input())
for i in range(101):
	if (n - i * 7) % 4 == 0 and n >= i * 7:
		print('Yes')
		return
print('No')


n = int(input())
ans = 'No'
for i in range(26):
	for j in range(26):
		count = 4 * i + 7 * j
		if count == n:
			ans = 'Yes'
			break
print(ans)


N = int(input())
x = 'No'
while N >= 0:
	if N % 4 == 0:
		x = 'Yes'
		break
	N -= 7
print(x)


n = int(input())
for x in range(n + 1):
	for y in range(n + 1):
		if x * 4 + y * 7 == n:
			print('Yes')
			return
print('No')


n = int(input())
for x in range(35):
	if (n - 7 * x) % 4 == 0 and n >= 7 * x:
		print('Yes')
		break
else:
	print('No')


n = int(input())
flag = False
for i in range(int(n / 4 + 1)):
	for j in range(int(n / 7 + 1)):
		if flag == False:
			if i * 4 + j * 7 == n:
				print('Yes')
				flag = True
if flag == False:
	print('No')


N = int(input())
print('Yes' if any((4 * i + 7 * j == N for i in range(N // 4 + 1) for j in range(N // 7 + 1))) else 'No')


n = int(input())
if n >= 18:
	print('Yes')
	return
ans_list = [4, 7, 8, 11, 12, 14, 15, 16]
if n in ans_list:
	print('Yes')
	return
else:
	print('No')


N = int(input())
ans = 'No'
for d in range(N // 7 + 1):
	if (N - 7 * d) % 4 == 0:
		ans = 'Yes'
		break
print(ans)


n = int(input())
while n >= 0:
	if n % 4 == 0:
		print('Yes')
		return
	else:
		n -= 7
print('No')


N = int(input())
c = 0
for i in range(N + 1):
	if i % 4 == 0 and (N - i) % 7 == 0:
		c = 1
print('Yes' if c == 1 else 'No')


n = int(input())
print('NYoe s'[n not in [1, 2, 3, 5, 6, 9, 10, 13, 17]::2])


N = int(input())
li = [4 * i + 7 * j for i in range(26) for j in range(15)]
print(['No', 'Yes'][N in li])


n = int(input())
dp = [False] * (n + 10)
dp[0] = True
for i in range(n):
	if dp[i]:
		dp[i + 4] = True
		dp[i + 7] = True
if dp[n]:
	print('Yes')
else:
	print('No')


N = int(input())
yes = any(((N - 4 * i) % 7 == 0 for i in range(N // 4 + 1)))
print('Yes' if yes else 'No')


n = int(input())
a = n // 7
b = n // 4
for i in range(a + 1):
	for j in range(b + 1):
		if 7 * i + 4 * j == n:
			print('Yes')
			return
print('No')


N = int(input())
l = [4 * x + 7 * y for x in range(26) for y in range(16)]
if N in l:
	print('Yes')
else:
	print('No')