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())
L = []
counter = 0
for i in range(26) :
    for j in range(16) :
        l = 4*i + 7*j
        L.append(l)
if N in L :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
#abc105b
import sys

n=int(raw_input())
for i in xrange(n/4+1):
 for j in xrange(n/7+1):
  if i*4+j*7==n:
   print 'Yes'
   sys.exit()
print 'No'

Submission status: Accepted

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


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

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

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

N=int(input())
flag=0
for i in range(26):
    for j in range(15):
        num=4*i+7*j
        if num==N:
            flag=1
            break
    if flag==1:
        break
if flag==0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())

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

print(f())

Submission status: Accepted

Solution code:
n = int(input())

for i in range(30):
    for j in range(30):
        if i * 4 + j * 7 == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
A=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
flag=False
for i in range(0,101,4):
    for j in range(0,101,7):
        if(i+j==n):flag=True

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

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"
for i in range(25):
    for j in range(15):
        if 4 * i + 7 * j == N:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
flag = False
N = int(input())
while N > 0:
    if N % 4 == 0 or N % 7 == 0:
        flag = True
        break
    else:
        N -= 7
if flag == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=int(input())
if a==1 or a==2 or a==3 or a==5 or a==6 or a==9 or a==10 or a==13 or a==17:
	print("No")
else:
	print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
(n - x) % 4

0 % 4 = 0
7 % 4 = 3
14 % 4 = 2
21 % 4 = 1

21以上なら7を0から3回引くことで4の倍数にできる
'''
n = int(input())
if n >= 21:
    flg = True
else:
    flg = False
    for i in range(21 // 4 + 1):
        for j in range(21 // 7 + 1):
            if 4 * i + 7 * j == n:
                flg = True
                break
print('Yes' if flg else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
doughnuts = 0
while doughnuts * 7 <= n:
    if (n - doughnuts * 7) % 4 == 0:
        print('Yes')
        break
    doughnuts += 1
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
cMax = round(100 / 4)
dMax = round(100 / 7)
result = "No"
for c in range(cMax):
  for d in range(dMax):
    if 4 * c + 7 * d == N:
      result = "Yes"
      break
print(result)

Submission status: Accepted

Solution code:
n = int(input())

a = 0
while 4 * a <= 100:
    b = 0
    while 4 * a + 7 * b <= 100:
        if (4 * a + 7 * b) == n:
            print("Yes")
            exit()
        b += 1
    a += 1
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    r = main()
    print(r)

Submission status: Accepted

Solution code:
N = int(input())
# N, N-7, N-14, N-21 の余りは重複しないので、どれかが必ず4の倍数
# そのため21以上はかならずYes. 21未満は個別に調べればいい
ans = 'No' if N in [1, 2, 3, 5, 6, 9, 10, 13, 17] else 'Yes'
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n <= 3:
    print("No")
elif n == 5:
    print("No")
elif n == 6:
    print("No")
elif n == 9:
    print("No")
elif n == 10:
    print("No")
elif n == 13:
    print("No")
elif n == 17:
    print("No")    
else:
    print("Yes")

Submission status: Accepted

Solution code:
n=int(input())
p=0
t=True
while p<26:
    r=n-(7*p)
    if r>=0 and r%4 ==0:
        t=False
        print("Yes")
        break
    p+=1
if t:
    print("No")

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

N = int(input())

cakes = 4
donuts = 7

for i in range(21):
    for j in range(18):
        if cakes * i + donuts * j == N:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
from itertools import product

N = int(input())

A = N // 4
B = N // 7

ret = False
for a, b in product(range(A + 1), range(B + 1)):
    p = 4 * a + 7 * b
    if p == N:
        ret = True
        break

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

Submission status: Accepted

Solution code:
N =int(input().strip())

lst = [4, 7]

num = 8

while num <= 100:

    for elem in lst:
        if elem + 4 == num or elem + 7 == num:
            lst.append(num)
            break
    num+=1

if N in lst:
    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:
N, = map(int, raw_input().split())
a = [0]*200
a[0] = 1
for i in range(0,100):
  a[i+4] = max(a[i+4], a[i])
  a[i+7] = max(a[i+7], a[i])
print "Yes" if a[N]==1 else "No"

Submission status: Accepted

Solution code:
N = int(input())

temp = False;

def fun(n):
	global temp;

	if temp == True:
		return;
	else:
		if n < 0:
			return;
		elif n == 0:
			temp = True;
		else:
			fun( n - 4 );
			fun( n - 7 );

fun(N);

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding: utf-8

N = int(input())

n_4 = int(N / 4)
n_7 = 0

ans = "No"
while n_4 > 0:
    # print(n_4, n_7)
    if 4 * n_4 + 7 * n_7 == N:
        ans = "Yes"
        break
    else:
        n_4 -= 1
        if N - (4 * n_4 + 7 * n_7) >= 7: n_7 += 1

if 7 * n_7 == N: print("Yes")
else: print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(20):
    for j in range(20):
        if 4*i+7*j == N:
            ans = 1
if ans == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())

ans = [0, 4, 7, 8, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
    28, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 36, 37, 38, 39, 39, 40, 40, 41,
    42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
    52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60,
    60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68,
    68, 68, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75,
    75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81,
    81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87,
    87, 88, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 91, 92, 92, 92, 92,
    93, 93, 93, 94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 96, 97, 97, 97, 98, 98,
    98, 98, 99, 99, 99, 99, 100, 100, 100, 100, 101, 101, 101, 102, 102, 102,
    102, 103, 103, 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 106, 106,
    107, 107, 107, 107, 108, 108, 108, 109, 109, 109, 110, 110, 110, 110, 111,
    111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 114, 115, 115, 115,
    116, 116, 116, 117, 117, 117, 118, 118, 118, 119, 119, 119, 120, 120, 120,
    121, 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, 124, 125, 125, 126,
    126, 126, 127, 127, 127, 128, 128, 128, 129, 129, 130, 130, 130, 131, 131,
    131, 132, 132, 133, 133, 134, 134, 134, 135, 135, 135, 136, 136, 137, 137,
    138, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 142, 143, 143, 144,
    144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151,
    152, 152, 153, 154, 154, 155, 155, 156, 156, 157, 158, 158, 159, 159, 160,
    161, 162, 162, 163, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171,
    172, 173, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 186, 187, 190,
    191, 194, 198]

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

Submission status: Accepted

Solution code:
n = int(input())

cake = 4
dounatsu = 7

c = list()
d = list()

c.append(0)
d.append(0)
for i in range(1,100):
    if i * cake > 100:
        break
    c.append(i*cake)

for j in range(1,100):
    if j * dounatsu > 100:
        break
    d.append(j*dounatsu)

for i in range(len(c)):
    for j in range(len(d)):
        if c[i] + d [j] == n:
            print("Yes")
            exit()
        else:
            continue
else:
    print("No")

#print(c)
#print(d)

Submission status: Accepted

Solution code:
N = int(input())
donuts = 7
cakes = 4
answer = 0
def calc1():
  for a in range(0,26):
    for b in range(0,26):
      if donuts * a + cakes * b == N:
        return 'Yes'
      elif donuts * a + cakes * b  > N:
        break
  return 'No'

print(calc1())

Submission status: Accepted

Solution code:
#coding:utf-8
n=int(input())
count=False
if(n%7==0):
	count=True
for i in range(int(n/7)+1):
	if(n%4==0):
		count=True
	else:
		n-=7
if(count==False):
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
A = input()

N = int(A)

list_4 = []
list_7 = []
list_numbers = []

for i in range(0, 25):
  list_4.append(4 * i)

for j in range(0,14):
  list_7.append(7 * j)

for i in range(0, 25):
  for j in range(0, 14):
    list_numbers.append(list_4[i] + list_7[j])

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

Submission status: Accepted

Solution code:
n = int(input())

flg = False
for i in range(100):
  for j in range(100):
    if 4*i+7*j == n: flg = True

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n//4+1):
  for j in range(n//7+1):
    if i == 0 and j == 0:
      continue
    if 4*i + 7*j == n:
      print("Yes")
      exit()
print("No")

Submission status: Accepted

Solution code:
text=input()
N=text

temp4=[4*i for i in range(25)]
temp7=[7*i for i in range(14)]

temp=list()
flg=False
for i in temp4:
    for j in temp7:
        temp.append(i+j)
        if int(N)==i+j:
            flg=True
            print("Yes")
            exit()

if flg:
    pass
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
for a in range(0,26):
    for b in range(0,15):
        if n == 4 * a + 7 * b:
            print('Yes')
            exit()
else:
    print('No')

Submission status: Accepted

Solution code:
#B
N=int(input())
A=[4,8,12,16,20,24,7,14,21,11,19,25,15,23,27]
if N>=28:
    print('Yes')
elif N in A:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = [0] * 300
for i in range(0,100,4):
 for j in range(0,101,7):
  a[i+j] = 1
n = int(input())
if a[n]==0:
 print("No")
else:
 print("Yes")

Submission status: Accepted

Solution code:
import sys
 
N = int(input())
 
for i in range(26):
  for j in range(16):
    if N == i * 4 + j * 7:
      print('Yes')
      sys.exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())
k = n // 7

for i in range(k+1) :
    rest = n - 7 * i
    if rest % 4 == 0 :
        print('Yes')
        break
else :
    print('No')

Submission status: Accepted

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

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

if not flag:
    print("No")

Submission status: Accepted

Solution code:
pre = []

for i in range(0, 100, 4):
    for j in range(0, 100, 7):
        pre.append(i + j)

if int(input()) in pre:
    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:
N = int(input())
L = [False] * 101
for i in range(30):
    for j in range(30):
        d = i*4 + j*7
        if d>100:
            break
        else:
            L[d] = True
print("Yes" if L[N] else "No")

Submission status: Accepted

Solution code:
N = int(input())
result = "No"
for i in range(101):
  for j in range(101):
    total = 4 * i + 7 * j 
    if N == total :
      result = "Yes"
      break
print(result)

Submission status: Accepted

Solution code:
def calc(n):
    ok_list = []
    for i in range(1, 25):
        for j in range(1, 15):
            if (7*j+4*i) <= 100:
                ok_list.append(7 * j + 4 * i)

    if n % 11 == 0 or n % 4 == 0 or n % 7 == 0 or n in ok_list:
        ans = 'Yes'
    elif n < 4:
        ans = 'No'
    else:
        num7 = int(n / 7)
        num4 = int(n / 4)
        n_7 = n - num7 * 7 
        n_4 = n - num4 * 4 
        if n_7 % 4 == 0 or n_4 % 7 == 0:
            ans = 'Yes'
        else:
            ans = 'No'
    return ans 


if __name__ == '__main__':
  n = int(input())
  print(calc(n))

Submission status: Accepted

Solution code:
n = int(input())
a = n // 4
res = 0
for i in range(a+1):
  N = 4*i
  if (n-N) % 7 == 0:
    res += 1

b = n//7    
for i in range(b+1):
  M = 7*i
  if (n-M) % 7 == 0:
    res += 1  
    
if res == 0 or n == 0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
judge = False
for i in range(0, 25):
    for j in range(0, 14):
        if (i * 4 + j * 7) == N:
            judge = True
            break
if judge:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

n=N%7
while(n<N):
    if(n%4==0):
        print('Yes')
        exit(0)
    else:
        n+=7

print('No')

Submission status: Accepted

Solution code:
N = int(input())
ans = "No"
if 3 < N:
    if (N % 4 == 0) or (N % 7 == 0):
        ans = "Yes"
    elif ((N % 4) % 7 == 0) or ((N % 7) % 4 == 0):
        ans = "Yes"
    x = 0
    while x <= N:
        x += 4
        if (N - x) % 7 == 0:
            ans = "Yes"
            break 
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

a = [False]*107

a[4-1] = True
a[7-1] = True

for i in range (100) :
   if a[i] == True :
      a[i+4] = True
      a[i+7] = True

if a[n-1] == True :
   print('Yes')
else :
   print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N%4 == 0 or N%7 == 0:
    print("Yes")
elif True:
    M = N%11
    if M%4 == 0 or M%7 == 0:
        print("Yes")
    else:
        for i in range(int((N-M)/11)):
            M = M+11
            if M%4 == 0 or M%7 == 0:
                print("Yes")
                break
        if N == M:
            print("No")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

c = 0
f = 25
s = 14
flag = "No"

for i in range(1,f):
  c = N - (i * 4)
  for j in range(1,s):
    if c >= 0 and c % (7 * j) == 0 and c >= 7 * j:
      flag = "Yes"
    
if N % 4 == 0 or N % 7 == 0:
  flag = "Yes"
  
print(flag)

Submission status: Accepted

Solution code:
# -*- coding UTF-8 -*-
import sys

N = int(input())
F = int(N/7)
F *= 7

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

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

Submission status: Accepted

Solution code:
n = int(input())

if n < 4:
    print('No')
    exit()
elif n % 7 == 0 or n % 4 == 0:
    print('Yes')
    exit()
elif n % 7 % 4 == 0 or n % 4 % 7 == 0:
    print('Yes')
    exit()
else:
    for i in range(1, n % 7):
        tmp = n - 7 * i
        if tmp < 0:
            break
        elif tmp % 4 == 0:
            print('Yes')
            exit()
    for i in range(1, n & 4):
        tmp = n - 4 * i
        if tmp < 0:
            break
        elif tmp % 7 == 0:                                                                                      
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
n = int(input())

i = 0
while(i <= n):
    if((n-i)%7 == 0):
        print("Yes")
        exit(0)
    i += 4
print("No")

Submission status: Accepted

Solution code:
N = int(input())
#4*x + 7*y = N
i = N // 7
ans = "No"
while(i>=0):
  if((N-7*i)%4 == 0):
    ans = "Yes"
    break
  else:
    i = i - 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 'No'

if ((N%7)==0):
    ans = 'Yes'

if ((N%4)==0):
    ans = 'Yes'

if (ans == 'No'):
    while(N > 6):
        N = N - 7
        if ((N%4) == 0):
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
if (N%4==0)or(N%7==0)or( (N%4==3)and(N!=3) )or( (N%7)==4 )or((N%4==2)and(N!=2)and(N!=6)and(N!=10)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

if N%4 == 1:
    if N < 21:
        print("No")
    else:
        print("Yes")

if N%4 == 2:
    if N < 14:
        print("No")
    else:
        print("Yes")


if N%4 == 3:
    if N < 7:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

for x in range(26):
    for y in range(16):
        if 4*x+7*y == n:
            print('Yes')
            sys.exit(0)
print('No')

Submission status: Accepted

Solution code:
N = int(input())

X = N // 7
i = 0
while i <= X:
    Y = N - 7 * i
    Z = Y % 4
    if Z == 0:
        print("Yes")
        break
    i += 1
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
q = 0
flug = 0
while q <= N :
	if N%7 == 0:
		flug = 1
		break
	
	if (N-q)%4 == 0:
		flug = 1
		break
	q = q + 7
 
if flug == 1:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

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

    print('No')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = "No"

x = 0
y = 0

while N >= 4 * x:
    y= 0
    while N >= (4 * x) + (7 * y):
        if N == (4 * x) + (7 * y):
            ans = "Yes"
            break

        y += 1

    if ans == "Yes":
        break
    
    x += 1



print(ans)

Submission status: Accepted

Solution code:
def solve(n):
    i = 0
    while i * 7 <= n:
        j = 0
        while 1:
            cnt = i * 7 + j * 4
            if cnt == n:
                return True
            elif cnt > n:
                break
            j += 1
        i += 1
    return False

if solve(int(input())):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for i in range(30):
  sum = n-4*i
  if sum>=0 and sum%7==0:
    flag = True
    break
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
N=int(input())
x="No"
for i in range(26):   
    for j in range(14):
        if N==4*i+7*j:         
            x="Yes"
print(x)

Submission status: Accepted

Solution code:
n = int(input())
flag = 'No'
if n%4==0:
    flag='Yes'
i=0
while n-4*i>0:
    if (n-4*i)%7==0:
        flag='Yes'
    i += 1

print(flag)

Submission status: Accepted

Solution code:
N = int(raw_input())
while True:
    if N % 4 == 0:
        print "Yes"
        break
    if N % 7 == 0:
        print "Yes"
        break
    if N < 0:
        print "No"
        break
    N = N - 4

Submission status: Accepted

Solution code:

N = int(input())
def b(N):
    a = False
    for x1 in range(N//4+1):
        cake = x1*4

        if (N-cake) % 7 == 0:
            a = True
        else:
            pass
    if a:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    b(N)

Submission status: Accepted

Solution code:
N = int(input())

flag = False
if N % 4 % 7 == 0 or N % 7 % 4 == 0 or N % 11 == 0:
    flag = True
else:
    value = N // 7

    for l in range(1, value+1):
        if (N - 7 * l) % 4 == 0:
            flag = True
            break

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

Submission status: Accepted

Solution code:
N = int(input())

def validate(N):
    for f in range(25):
        for s in range(15):
            if N == 4 * f + 7 * s:
                return "Yes"
    return "No"

print(validate(N))

Submission status: Accepted

Solution code:
n=int(input())
a=0
b=0
flag=0
while a<=n and flag==0:
    b=0
    while b<=(n-a):
        if b+a==n:
            print("Yes")
            flag=1
            break
        b=b+7
    a=a+4
    
if flag==0:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n=raw_input()
ina=int(n)
des=0
for x in range(26):
    for y in range(16):
        ans=4*x+7*y
        if ans==ina:
            des=des+1
if des>0:
    print "Yes"
else:
    print"No"

Submission status: Accepted

Solution code:
N=int(input())
L = []
for j in range(25):
    for i in range(15):
        l = 4*j+7*i
        L.append(l)
if N in L :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
#encoding utf-8

n = int(input())

max_donut = int(n/7)+1
judge = False
for i in range(max_donut):
    if (n-i*7)%4 == 0:
        judge = True

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

Submission status: Accepted

Solution code:
n = int(input())
x = 1+n//4
q = ['No','Yes']
s = 0
for a in range(x):
  if (n-a*4)%7==0:
    s += 1
    break
        
print(q[s])

Submission status: Accepted

Solution code:
n = int(input())

flag = 'No'

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

print(flag)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
a = int(input())

b = math.ceil(a/7)
c = math.floor(a/4)

for i in range(b,c+1):
    x = 7*i-a
    y = a-4*i
    if x%3==0 and y%3==0:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

ans = "No"

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
check = False
if N % 4 == 0 or N % 7 == 0:
    check = True
else:
    for i in range(25):
        for j in range(25):
            if 4 * (i + 1) + 7 * (j + 1) == N:
                check = True
                break
if check is True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())

ans = 'No'
tmp = 0
x = 0
y = 0

if N < 4:
    pass
else:
    if N % 7 == 0:
        ans = 'Yes'
    elif N % 4 == 0:
        ans = 'Yes'
    else:
        y = N // 7
        for i in range(y):
            x = 1
            tmp = 4*x + 7*y
            while  tmp < N:
                tmp = 4*x + 7*y
                x += 1
            if tmp == N:
                ans = 'Yes'
                break
            y -= 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
if n%11==0 or n%7==0 or n%4==0:
    print("Yes")
else:
    i=1
    flag=0
    m=1
    while n>0 and m>0:
        m=n-(7*i)
        t=n-m
        #print(t,m)
        if m>0 and n>0 and (t%7==0 or t%4==0 or t%11==0) and (m%4==0 or m%7==0 or m%11==0):
            #print(n,m)
            flag=1
            break
        i+=1
    if flag==1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
num = int(input())
lis = []
for i in range(26):
    for m in range(15):
        lis.append((4*i)+(7*m))
print("Yes" if num in lis else "No")

Submission status: Accepted

Solution code:
[n]=[int(x) for x in input().split()]

ok=0
for i in range(100):
  for j in range(100):
  
    if i*4+j*7==n: ok +=1
print("Yes" if ok >0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
flag = False
for i4 in range(30):
    for i7 in range(20):
        if (i4*4)+(i7*7)==N:
            flag = True
            break
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
n = int(input())

flg = False

for i in range(26):
  t = n - i*4
  if(t < 0):
    break
  elif(t == 0):
    flg = True
    break
  else:
    if(t % 7 == 0):
      flg = True
      break

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

Submission status: Accepted

Solution code:
N=int(input())

A=0

for i in range(N):
    for k in range(N):
        if 4*i+7*k==N:
            print("Yes")
            break
        else:
            pass
    if 4*i+7*k==N:
        break
    else:
        pass
    
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
k=False
for i in range(26):
    for j in range(14):
        if 4*i+7*j==n:
            k=True
print('Yes' if k else 'No')

Submission status: Accepted

Solution code:
import sys

N = int(input())

for cake in range(25):
    for donatu in range(14):
        if N == 4 * cake +  7 * donatu:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
n=int(input())
ans='No'
for i in range(0,25):
    for j in range(0,14):
        if n - (i*4) - (j*7) == 0:
            ans='Yes'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0

for i in range(26):
  for j in range(15):
    n = 4*i + 7*j
    if n == N:
      ans = 1
      break
  if ans == 1:
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
for i in xrange(n // 7 + 1):
    if (n - i * 7) % 4 == 0:
        print "Yes"
        break
else:
    print "No"

Submission status: Accepted

Solution code:
N = int(input())
ans = 'No'
for cake in range(26):
    for donatsu in range(15):
        if 4*cake + 7*donatsu == N:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
import numpy as np
a = np.empty((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

n = input()
n = int(n)

cake = 4
donut = 7

for i in range(math.floor(n/donut)+1):
    if(n - donut * i) % cake == 0:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
def slv(n):
    l1=list(range(0,26))
    l2=list(range(0,16))
    for i in l1:
        for j in l2:
            if(i*4+j*7 == n):
                return "Yes"
    return "No"
n = int(input())
print(slv(n))

Submission status: Accepted

Solution code:
def cal_ans(num):
    for num1 in range(25):
        for num2 in range(15):
            if num1 * 4 + num2 * 7 == num:
                return "Yes"
    return "No"


if __name__ == '__main__':
    N = int(input())
    print(cal_ans(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

k = 0
T = False

while N-(k*7)>0:
    if (N-(k*7))%4 == 0:
        T = True
        break
    k += 1

if N-(k*7)==0:
    T = True

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
for i in range(int(N/4) + 1):
    amount = i * 4
    for j in range(int(N/7) + 1):
        if(j == 0):
            pass
        else:
            amount += 7
        if(amount == N):
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
n = int(input())
array = []
for i in range(0, 101, 4):
    for j in range(0, 101, 7):
        array.append(i)
        array.append(i+j)
if n in array:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())

    r = 'No'

    for i in range(20):
        for j in range(20):
            if 4 * i + 7 * j == N:
                r = 'Yes'
                break

    print(r)