Problem:


Score : 200 points

Problem Statement

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 1

11

Sample Output 1

Yes

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

Sample Input 2

40

Sample Output 2

Yes

If you buy ten cakes, the total will be 4 \times 10 = 40 dollars.

Sample Input 3

3

Sample Output 3

No

The prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.



Sample input:
11


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
flag= True
N = int(input())
for i in range(0,26):
    if (N-4*i) % 7==0:
        flag=False
        break
    elif (N-4*i)<0:
        break
if flag==True:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = input()
n = int(n)
if n >= 20 or n % 7==0 or n%4==0 or n == 19 or n == 18 or n == 15 or n == 11:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
obj = {}


def f(n):
    if n in obj:
        return obj[n]
    if n < 4:
        obj[n] = False
        return False
    if n == 4 or n == 7:
        obj[n] = True
        return True
    if f(n - 7):
        obj[n] = True
        return True
    if f(n - 4):
        obj[n] = True
        return True


def main():
    N = int(input())
    if f(N):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
ans = 'No'
if n % 4 == 0:
    ans = 'Yes'
elif n % 7 == 0:
    ans = 'Yes'
else:
    tmp = 4
    while tmp <= n:
        if (n - tmp) % 7 == 0:
            ans = 'Yes'
            break
        else:
            tmp += 4
    if ans != 'Yes':
        tmp = 7
        while tmp <= n:
            if (n - tmp) % 4 == 0:
                ans = 'Yes'
                break
            else:
                tmp += 7

print(ans)

Submission status: Accepted

Solution code:
import math
money, = list(map(int,input().split()))

max_number = math.ceil(money/4 + 1)

ans = 'No'

for i in range(max_number):
    for j in range(max_number):
        if  money == i*4 + 7*j:
            ans = 'Yes'
            
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    maxCakes = n // 4
    maxDonuts = n // 7
    res = 'No'
    for c in range(maxCakes+1):
        for d in range(maxDonuts+1):
            if 4*c + 7*d == n:
                res = 'Yes'
    print(res)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a,b=4,7
result="No"
for i in range(25):
  for j in range(15):
    if a*i+b*j==n:
      result="Yes"
print(result)

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

for i in range(0,25):
    for j in range(0,20):
        if 4*i + 7*j == N:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

check=0
if n<4:
    check=1
    print('No')
elif n%4==0 or n%7==0:
    check=1
    print('Yes')
else:
    while n>7:
        n-=7
        if n%4==0:
            check=1
            print('Yes')
            break

if check==0:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
if 1 <= N <= 100:
    for i in range(0,25):
        for v in range(0,14):
            if (4 * i) + (7 * v) == N:
                print('Yes')
                break
        if (4 * i) + (7 * v) == N:
            break
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:

Sum = int(input())

r = 0
for i in range(26):
    for k in range(15):
        if 4*i+7*k == Sum:
            r = r +1
        else:
            r = r
if r > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

N = int(input())

if N == 4:
	print('Yes')
	sys.exit()
p = N//7
q = N%7
if p < 1:
	print('No')
	sys.exit()
for i in range(p):
	if q % 4 == 0:
		print('Yes')
		sys.exit()
	else:
		q = (q+7)%4
		if q == 0:
			print('Yes')
			sys.exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())

l = []

for i in range(0,26):
    t = 4*i
    l.append(t)
    for j in range(0,15):
        t = t  + 7*j
        if t > 100:
            continue
        l.append(t)
    if t > 100:
        continue

if (n in l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

res = 0

for x in range(26):
    if res == 1:
        break
    for y in range(15):
        if n == 4*x + 7*y:
            res = 1
            break

if res == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
n = int(input())
a = [0]
b = [0]
for i in range(1, 101):
    if i % 4 == 0:
        a.append(i)
    if i % 7 == 0:
        b.append(i)
arr = list(itertools.product(a, b))
ans = [sum(i) for i in arr]
if n in ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8

CAKE = 4
DONUT = 7
UPPER_LIMIT = 100
flg = False

n = int(input())

for i in range(UPPER_LIMIT // CAKE + 1):
    if CAKE * i > n:
        break
    
    if (n - CAKE * i) % 7 == 0:
        flg = True
        break

print('Yes' if flg else 'No')

Submission status: Accepted

Solution code:
n = int(input())

ttt = False 
for k in range(int(n/7)+1):
    if (n - 7*k) % 4 == 0:
        ttt = True
if ttt:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
cou = 0
if n < 4:
  print("No")
  exit()
while 1:
  if n % 7 == 0:
    print("Yes")
    exit()
  n -= 4
  if n < 0:
    print("No")
    exit()

Submission status: Accepted

Solution code:
N = int(input())

if N % 4 == 0:
    print("Yes")
    exit()
elif N % 7 == 0 :
    print("Yes")
    exit()





for i in range(1, (N // 7) + 1):
    div = 7 * i
    ret = N -  div 
    if ret % 4 == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import numpy as np
a = int(input())
if(a > 7):
	c = np.zeros(a)
	for i in range(7):
		if(i == 3 or i == 6):
			c[i] = 1
	#print(c)
	for i in range(7, c.shape[0]):
		if(c[i-4] == 1 or c[i-7] == 1):
			c[i] = 1
	if(c[-1] == 1):
		print("Yes")
	else:
		print("No")
else:
	if(a == 4 or a == 7):
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = 0
while n >= 0:
    if n % 7 == 0:
        a += 1
        break
    n -= 4
if a == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a = int(input())
i = 0
f = 0
while i*4 <= a:
    if (a - (4*i))%7 == 0:
        f = 1
        break
    i += 1
if f == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

flag = False

for i in range(0, 30):
    for j in range(0, 20):
        if 4 * i + 7 * j == n:
            flag = True
            break
    if flag:
        break

if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
if (N % 7 == 0) or (N % 7 == 4):
  print('Yes')
  exit()
a = int(N / 7)
for i in range(a+1):
  N_ = N - 7 * i
  if N_ % 4 == 0:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N//7 + 1):
    if (N - 7 * i) % 4 == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

for x in range(int(100/7)):
    for y in range(int(100/4)):
        if (n == 7*x + 4*y):
            print('Yes')
            exit(0)
print('No')
exit(0)

Submission status: Accepted

Solution code:
N = int(input())
L = [1,2,3,5,6,9,10,13,17]

if(N in L):	print("No")
else:	print("Yes")

Submission status: Accepted

Solution code:
# vim: set fileencoding=utf-8 :
n = int(raw_input())
flag1 = 0
flag2 = 0

if n % 4 == 0 or n % 7 == 0:
    print("Yes")
    exit()

for i in range(n / 4):
    if (n - i * 4) % 7 == 0:
        flag1 = 1

for i in range(n / 7):
    if (n - i * 7) % 4 == 0:
        flag2 = 1

if flag1 == 1 or flag2 == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
b = int(n / 7)
c = 0
for i in range (0, b+1):
	a = n - 7 * i
	if c == 0:
		if a % 4 == 0:
			print("Yes")
			c = 1
if c == 0:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())						# 5

Y="Yes"
ans="No"

if N<4:
	print(ans)
	exit(0)

if (N % 4 ==0)or(N % 7 ==0):
	print(Y)
	exit(0)

if ((N % 7) % 4)==0:
	print(Y)
	exit(0)

if ((N % 4) % 7)==0:
	print(Y)
	exit(0)


for i in range(16):
	a = N - (7*i)
	if a<4: continue
	
	if a%4==0:
		ans=Y
		break


print(ans)

Submission status: Accepted

Solution code:
N = int(input())

flag = False
for i in range(26):
    for j in range(15):
        if (4*i + 7*j == N):
            flag = True

print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
N = int(input())
a = [4 * i for i in range(26)]
b = [7 * i for i in range(15)]

for i in a:
    for j in b:
        if i + j == N:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())
a = 0
if n % 4 == 0 or n % 7 == 0:
    print("Yes")
else:
    for i in range(n//4):
        n -= 4
        if n % 7 == 0:
            print("Yes")
            exit()
    print("No")

Submission status: Accepted

Solution code:
def main():
    n = int(input().strip())

    for i in range(100//4+1):
        m = i * 4
        if n < m:
            break
        for j in range(0, n//7+1):
            #print(i, j)
            m = i * 4 + j * 7
            if n == m:
                print('Yes')
                return
            if n < m:
                break


    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a = int(input())


ans = "No"
for i in range(a//4 + 1):
    for j in range(a//7 + 1):
        if i*4 + j*7 == a:
            ans = "Yes"
            break
    else:
        continue
    break

# 出力
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

if n % 4 == 0 or n % 7 == 0:
    print('Yes')
    exit()

for i in range(1,26):
    for j in range(1,15):
        if n == (4*i + 7 * j):
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
N = int(input())

flag = False
for ic in range(N//4+1):
    for id in range(N//7+1):
        if ic*4+id*7 == N:
            flag = True
            break
    if flag:
        break

if flag == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

    if (n / 4 >= 1 and n % 4 in [0, 3]) or n / 7 >= 1 and n % 7 in [0, 1, 5]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = input()
    a = 0
    b = 0
    while(a < 15):
        b = 0
        while(b < 26):
            if(7 * a + 4 * b == n):
                print 'Yes'
                quit()
            b += 1
        a += 1
    print 'No'

Submission status: Accepted

Solution code:
goukei = int(input())
ans = 'No'
for cake in range(0, int(goukei / 4) + 1):
    Nokori = goukei - cake * 4
    if Nokori % 7 == 0: ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline())

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

Submission status: Accepted

Solution code:
n = int(input())
i = 0
flag = False
while(7*i<=n):
  if (n-7*i)%4 == 0:
    flag = True
    break
  i+=1
if flag:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ok = False
for i in range(26):
	if (n - 4 * i) % 7 == 0 and (n - 4 * i) // 7 >= 0:
		ok = True

if ok:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
# B
# 4, 8, 12, 16, 20, 24
# 7, 11, 15, 19, 23
# 14, 18, 22
# 21, 25
N = int(input())
if N in [1, 2, 3, 5, 6, 9, 10, 13, 17]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
from sys import stdin, stdout

input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    N = int(input())

    cake = 0
    dounut = 0
    while 1:
        dollars = N - cake * 4
        if dollars < 0:
            print('No')
            break
        elif not dollars % 7:
            print('Yes')
            break
        cake += 1

main()

Submission status: Accepted

Solution code:
N = int(input())

flag = False

for i in range(14+1):
    for j in range(25+1):
        if N == (7*i + 4*j):
            if flag == False:
                print('Yes')
                flag = True
            break

if flag == False:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())

num_list=[]

for i in range(0,26):
  for j in range(0,14):
    num_list.append(i*4+j*7)


if (n in num_list):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def main():
    string = int(input())
    non = {1,2,3,5,6,9,10,13,17}
    num = {string}
    if non & num:
        print("No")
    else:
        print("Yes")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = int(input())

m = 100
d4 = int(m / 4)
d7 = int(m / 7)

ys = set()
for i in range(0, d4 + 1):
    for j in range(0, d7 + 1):
        y = 4 * i + 7 * j
        if y > 100:
            continue
        ys.add(y)

if n in ys:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
res_list = []
for i in range(N//4+1):
    for j in  range(N//7 + 1):
        if i*4 + j * 7 <=N:
            res_list.append(i*4 + j * 7)
if N in res_list:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(26):
  rest = n - 4*i
  if rest < 0:
    print("No")
    break
  if rest%7 == 0:
    print("Yes")
    break
else:
  print("No")

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 'No'
for c in range(100):
    for d in range(100):
        if 4*c + 7*d == N:
            ans = 'Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
n4 = [i*4 for i in range(26)]
n7 = [i*7 for i in range(15)]
ans = 0
for i in n4:
    if n-i in n7:
        ans = 1
print("Yes" if ans == 1 else "No")

Submission status: Accepted

Solution code:
N=int(input())

max7=N//7
max4=N//4
bool_N=False

for i in range(max7+1):
    for j in range(max4+1):
        if 7*i+4*j==N:
            bool_N=True

if bool_N:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#coding:utf-8

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


n = int(input())
ans = 'No'

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

Submission status: Accepted

Solution code:
a=int(input())

b=int(a/7)
c=int(a/4)
k=0

for i in range(b+1):
    for j in range(c+1):
        if 7*i+4*j==a:
            k=1
if k==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:


N = int(input())

if N%4==0 or N%7==0:
    print("Yes")
    exit()


for i in range(25):
    if (N - (i+1)*4) < 0:
        print("No")
        break
    if ((N - (i+1)*4) % 7)==0:
        print("Yes")
        break

Submission status: Accepted

Solution code:
n = int(input())
for i in range(0,101,4):
  for j in range(0,101,7):
    if (i + j) > 100:
      break
    if n == (i + j):
      print('Yes')
      quit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

flg = False
neg, i = 0, 0
while neg < n:
    neg = i * 4
    if (n - neg) % 7 == 0:
        flg = True

    i += 1

if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

V_max = N // 4
V_min = N // 7

if N % 4 == 0 or N % 7 == 0:
    print('Yes')
    exit()

tmp = N
for i in range(1,V_max):
    tmp = N - i*4
    if tmp % 7 == 0:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
N = int(input())
flag = 'No'
for i in range(101):
	for j in range(101):
		if 4 * i + 7 * j == N:
			flag = 'Yes'
			print(flag)
			exit()
print(flag)

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N//4+1):
    if not (N-4*i) % 7:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

def calc(x, y):
    return 4 * x + 7 * y

max4 = N // 4 + 2
max7 = N // 7 + 2

re = 'No'
for i in range(max4):
    for j in range(max7):
        if calc(i, j) == N:
            re = 'Yes'
            break
            
print(re)

Submission status: Accepted

Solution code:
c = 4 * 7
n = int(input())
if n == c:
    print("Yes")
    exit()
m = n % c
i = n
while 0 < i:
    j = i
    while 0 < j:
        j -= 7
        if j == 0:
            print("Yes")
            exit()
    i -= 4
    if i == 0:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

for i in range(30):
    for j in range(20):
        price = i * 4 + j * 7

        if price == N:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

flag = 0
for i in range(26):
    if (N - i * 4) >= 0:
        if (N - i * 4) % 7 == 0:
            flag = 1

if flag == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def solve(n):
    for i in range(n // 4 + 1):
        if (n - i * 4) % 7 == 0:
            return "Yes"
    return "No"

if __name__ == "__main__":
    n = int(input())
    print(solve(n))

Submission status: Accepted

Solution code:
N = int(input())
c4 = 0
judge = "No"

while c4*4 <= N:
    M = N - c4*4
    if M % 7 == 0:
        judge = "Yes"
    c4 += 1

print(judge)

Submission status: Accepted

Solution code:
import sys

n = int(input())

while n >= 4:
  if n % 4 == 0:
    print('Yes')
    sys.exit()
  else:
    n -= 7

if n == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
ans=0
for a in range(25):
  for b in range(25):
    if 4*a+7*b==n:
      ans +=1
if ans:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = [0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100]
c = [0,7,14,21,28,35,42,49,56,63,70,77,84,91,98]
d = 0

for i in range(len(b)):
	for j in range(len(c)):
		if b[i] + c[j] == a:
			print("Yes")
			d = 1
			break
	if d == 1:
		break
if d == 0:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())

def func(n):
  cake = [4,7]
  for i in cake:
    new_n = n - i
    if new_n == 0:
      print('Yes')
      exit()
    elif new_n < 0:
      return 0
    else:
      func(new_n)

func(N)
print('No')

Submission status: Accepted

Solution code:
N = int(input())

a = N%7
b = N//7
if a == 0:
    print("Yes")
    quit()
for k in range(b+1):
    if a%4 == 0:
        print('Yes')
        quit()
        
    a+=7
print('No')

Submission status: Accepted

Solution code:
N = int(input())
flag = True

for i in range(N // 7 + 1):
	if (N - i*7) % 4 == 0:
		print("Yes")
		flag = False
		break
		
if flag:
	print("No")

Submission status: Accepted

Solution code:
N=int(input())

for i in range(26):
    for j in range(16):
        if 4*i+7*j == N:
            print('Yes')
            quit()
        else:
            pass
print('No')

Submission status: Accepted

Solution code:
n = int(input())

i = 0
while n - 7 * i > 0:
     x = n - 7 * i
     if x % 4 ==0:
         print("Yes")
         break
     i += 1
else:
    if n % 7 ==0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N=int(input())
flag=0
for A in range(26):
  for B in range(15):
    if 4*A+7*B==N:
      flag=1
if flag==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python

n = int(input().strip())

success = False
for i in range(26):
    for j in range(15):
        if (4 * i + 7 * j) == n:
            success = True
            break

if success:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = int(input())
answer = False
for i in range(0, a//4 + 1):
	if (a - i*4) % 7 == 0:
		print ('Yes')
		answer = True
		break
		
if answer== False:
	print ('No')

Submission status: Accepted

Solution code:
N = int(input())


while(N > 0):
	if not N % 4:
		print("Yes")
		break

	N -= 7
else:
	if not N:
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
n = int(input())

all_num = set()
for a in range(100):
    for b in range(100):
        v = a * 4 + b * 7
        if v <= 100:
            all_num.add(v)
if n in all_num:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

S = 1 + int(N / 7)
F = 1 + int(N / 4)
for s in range(S):
    for f in range(F):
        if 7 * s + 4 * f == N:
            print("Yes")
            quit()


print("No")

Submission status: Accepted

Solution code:
N = int(input())
tmp = [0] * 101
tmp[1] = tmp[2] = tmp[3] = 0
tmp[4] = tmp[7] = 1
for k in range(4, 101):
  if tmp[k] == 0:
    continue
  if k + 4 <= 100:
    tmp[k + 4] += 1
  if k + 7 <= 100:
    tmp[k + 7] += 1
ans = 'Yes' if tmp[N] >= 1 else 'No'
print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
for i in range(30):
    for j in range(30):
        tmp = 4*i+7*j
        if tmp <= 100:
            if tmp == N:
                print("Yes")
                sys.exit(0)
        else:
            break
print("No")

Submission status: Accepted

Solution code:
N= int(input())
if N>17 or (N<17 and N>13) or N==12 or N==11 or N==8 or N==7 or N==4:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
flg = False
for i in range(25):
    sums = i * 4
    while sums <= n:
        if sums == n:
            flg = True
            break
        sums += 7
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

for i in range(0,14):
        for j in range(0,25):
                if N == 7*i+4*j:
                        print("Yes")
                        break
        else:
                continue
        break
else:
        print("No")

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"
i7 = 0


while(True):
    N -= i7 * 7
    if N < 0:
        break
    if N % 4 == 0 or N == 0:
        ans = "Yes"
        break
    i7 += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for n in range(int(N//4)+1):
    for m in range(int(N//7)+1):
        if (4*n) + (7*m) == N:
            flag = True
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())

q=int(n/7)
flag=0

for i in range(q+1):
  if (n-7*i)%4==0:
    flag=1
    break

if flag==0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n=int(input())

value=[]

for i in range(100):
    for j in range(100):
        value.append(4*i+7*j)

if n in value:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    flag = False
    for i in range(0, 26):
        for j in range(0, 15):
            sumv = 4 * i + 7 * j
            if ( sumv == n ):
                flag = True
                break
        if flag:
            break
    if flag:
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
N = int(input())
for i in range(0, 26):
    for j in range(0, 25):
        if 4 * i + 7 * j == N:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys
n = int(input())

for i in range(100):
    for j in range(100):
        if i == 0 and j == 0:
            continue
        if n % (i * 4 + j * 7) == 0:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
N = int(input())
# N, K = map(int, input().split())
# c = list(map(int, input().split()))
# d = [list(map(int, input().split())) for _ in range(N)]
# s = input()


ans = "Yes"

if N < 4:
    ans = "No"
elif 5<=N<=6:
    ans = "No"
elif 9<=N<=10:
    ans = "No"
elif 13<=N<=14:
    ans = "No"
elif 17==N:
    ans = "No"



print(ans)

Submission status: Accepted

Solution code:
X=int(input())
Y=X
Z=X
F=0
while F==0 and (Y>=0 or Z>=0):
	Y-=4
	Z-=7
	if Y%7==0 and (Y>=7 or Y==0):
		F=1
		break
	if Z%4==0 and (Z>=4 or Z==0):
		F=1
		break
if F==1:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

a4 = N // 4

ans = False
for i in range(a4+1):
	if (N - i*4) % 7 == 0:
		ans = True
		break

if ans:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())

for f in range(0, 25):
    for s in range(0, 14):
        if f*4 + s*7 == N:
            print("Yes")
            exit()
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

flag = 0

for i in range((N // 4) + 1):
  for j in range((N // 7) + 1):
    if 4*i + 7*j == N:
      print("Yes")
      flag = 1
      break
  if flag == 1:
    break
      
if flag == 0:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

for i in range(1000):
	for j in range(1000):
		if 4*i + 7*j == n:
			print 'Yes'
			quit()

print 'No'

Submission status: Accepted

Solution code:
N = int(input())

if N <= 3 or 5<= N <= 6:
    print("No")
else:
    while True:
        if N < 0:
            print("No")
            break
        elif N%4 == 0:
            print("Yes")
            break
        N = N-7

Submission status: Accepted

Solution code:
li = list(map(int,input().split()))
n=li[0]
for i in range(0,15):
    a = n - i*7
    if a<0:
        print("No")
        break
    if a%4 == 0:
        print("Yes")
        break

Submission status: Accepted

Solution code:
N = int(raw_input())
retval = False
if N < 4:
    retval = False
else:
    x_max = N/4
    y_max = N/7
    for i in range(1, x_max+1):
        if (N - i*4) % 7 == 0:
            retval = True
            break
    for i in range(1, 1+y_max):
        if (N - i*7) % 4 == 0:
            retval = True
            break
if retval:
    print 'Yes'
else:
    print 'No'

Submission status: Accepted

Solution code:
def solve(N):
    e = lambda x, y, N: (4*x + 7*y) == N
    for x in range(N//4+1):
        for y in range(N//7+1):
            if e(x, y, N):
                print("Yes")
                return
    else:
        print("No")

N = int(input())
solve(N)

Submission status: Accepted

Solution code:
N = int(input())
multi4 = range(0,101,4)
multi7 = range(0,101,7)
bigmulti = set()
for i in multi4:
    for j in multi7:
        bigmulti.add(i+j)
if N in bigmulti:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
dp = [0] *101
dp[0] = 1
for i in range(4,101):
  if dp[i-4] != 0:
    dp[i] = 1
for i in range(7,101):
  if dp[i-7] != 0:
    dp[i] = 1
if dp[n] == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

i = 0
while i * 4 <= 100:
    j = 0
    while j * 7 <= 100:
        if i * 4 + j * 7 == N:
            print("Yes")
            exit()
        j += 1
    i += 1
print("No")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    for i in range(N//4+1):
        if (N-4*i)%7 == 0:
            return "Yes"
    return "No"

if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
import math

if __name__ == "__main__":
    N = int(input())

    if N == 7:
        print("Yes")
        exit()

    max_7 = math.floor(N / 7)
    for i in range(max_7, -1, -1):
        rest = N - i*7
        if rest%4 == 0:
            print("Yes")
            exit()

    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l4 = n//4
l7 = n//7
judge = False

for i in range(l4+1):
    for j in range(l7+1):
        sum = i * 4 + j * 7
        if n == sum:
            judge = True
            break


if judge:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

cost = 0
for i in range(0,16):
    for j in range(0,26):
        cost = 7 * i + 4 * j
        #print(cost)
        if cost == N:
            print("Yes")
            exit()

print("No")