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.

Solution (Python):
s = input()
n = int(s)

price = 0
in_four = 0
in_seven = 0
check = False

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

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

Solution (Python):
import math
n = int(input())

f = []
s = []
tmp = 0
ans = 0
a = math.floor(n/4)
b = math.floor(n/7)
cnt = 0
for i in range(a):
  f.append(4)
if (n % 4) == 0:
  cnt = 1
for i in range(0, len(f)):
  ans = (n-4*i) % 7
  if ans == 0:
    cnt = 1
    break
  ans = 0
if cnt == 1:
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())

ans = False
for d in range(0, (n + 1), 7):
    if (n - d) % 4 == 0:
        ans = True
        break
print('Yes' if ans else 'No')

Solution (Python):
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')
            exit()
print('No')

Solution (Python):
import sys
n = int(input())
for i in range(n+1):
  for j in range(n+1):
    if 4 * i + 7 * j == n:
      print("Yes")
      sys.exit()
print("No")

Solution (Python):
N=int(input())
for i in range(N//4+1):
  tmp = N - 4*i
  if tmp >= 0 and tmp % 7 == 0:
    print('Yes')
    exit()
print('No')

Solution (Python):


n = int(input())

a = 0

while(1):
    tmp = n - 7*a
    if tmp % 4 == 0:
        print("Yes")
        exit()
    a += 1
    if a*7 > n:
        print("No")
        exit()

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

max_a = 100 // 4
max_b = 100 // 7
A = False

for a in range(max_a+1):
    if A == True:
        break
    for b in range(max_b+1):
        total = a*4 + b*7
        if total == N:
            A = True
            break
        if total != N:
            A = False
            continue
            
if A == True:
    print('Yes')
if A == False:
    print('No')

Solution (Python):
N=int(input())
res=False
for i in range(N//7+1):
    if (N-7*i)%4==0:
        res=True
        break

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

Solution (Python):
n = int(input())
quotient = n // 4
rep = [4*i for i in range(quotient+1)]
flag = False
while rep[0] <= n:
  if n in rep:
    print('Yes')
    flag = True
    break
  rep = [7+ele for ele in rep]

if not flag:
  print('No')

Solution (Python):
N = int(input())
if N == 1 or N == 2 or 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')

Solution (Python):
N = int(input())
p = [i for i in range(101)]
q = [i for i in range(101)]
ans = 'No'

for a in p:
    for b in q:
        if 4*a+7*b == N:
            ans = 'Yes'
            break
        else:
            pass
print(ans)

Solution (Python):














































def calculation(lines):
    N = int(lines[0])
    result = 'No'
    for i in range(25):
        for j in range(15):
            if i*4 + j*7 == N:
                result = 'Yes'
    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['11']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['40']
        lines_export = ['Yes']
    if pattern == 3:
        lines_input = ['3']
        lines_export = ['No']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):

import math

N = int(input())


ans = 0
flg = True


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

Solution (Python):

N = int(input())


C_list=[]

for i in range(26):
  for j in range(15):
    C_list.append(4*i + 7*j)

cnt = 0
for i in range(len(C_list)):
  if C_list[i] == N:
    cnt += 1

if cnt >= 1:
  print("Yes")
else:
  print("No")

Solution (Python):
a=int(input())
result=[]
for i in range(26):
    for j in range(26):
        result.append(i*4+j*7)

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

Solution (Python):
N = int(input())
count = 0
for i in range(26):
  for j in range(15):
    if i*4 + j*7 == N:
      count +=1
if count > 0:
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())

def dfs(total):
    if total>=n:
        if total==n:
            print('Yes')
            exit()
        return
    dfs(total+4)
    dfs(total+7)

dfs(0)
print('No')

Solution (Python):
N = int(input())
flag = False
for i in range(101):
  if 4*i > N:
    break
  else:
    a = (N -i*4) % 7
    if a == 0:
      flag = True
      break
if flag:
  print("Yes")
else:
  print("No")

Solution (Python):


import math

import itertools
from collections import deque
from collections import Counter

from fractions  import gcd

import bisect
n=int(input())
i=0
while True:
    if i*4>n:
        print("No")
        break
    if (n-i*4)%7==0:
        print("Yes")
        break
    i+=1

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

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

Solution (Python):
n = int(input())

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

Solution (Python):
x = int(input())

combination = []
for i in range(26):
  for j in range(15):
    total = i*4 + j*7
    combination.append(total)
print('Yes' if x in combination else 'No')

Solution (Python):
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)

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

A = list(range(4, 101, 4))
B = list(range(7, 101, 7))

is_made = False

if N in A or N in B:
    is_made = True
else:
    for a in A:
        for b in B:
            if a+b > N:
                break
            elif a+b == N:
                is_made = True
                break

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    num = 0
    while num <= n:
        if (n - num) % 7 == 0:
            print('Yes')
            sys.exit()
        num += 4
    print('No')


if __name__ == '__main__':
    main()

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

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

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

lst = []

for i in range(26):
    for j in range(15):
        if i*4+j*7 > 100:
            break
        else:
            lst.append(i*4+j*7)


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

Solution (Python):
fo=0
fou=[0]
se=0
sev=[0]
fl=False
while fo<100:
  fo+=4
  fou.append(fo)
while se<100:
  se+=7
  sev.append(se)
n=int(input())
for i in fou:
  for j in sev:
    if n==i+j:
      fl=True
      print("Yes")
      break
  if fl:
    break
else:
  print("No")

Solution (Python):
def main():
    n=int(input())
    for i in range(26):
        if i*4 <= n and (n-i*4) % 7 == 0:
            print("Yes")
            return
    print("No")
    
if __name__ == "__main__":
    main()

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

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

Solution (Python):
import math
def main():
  n = int(input())
  flg=0
  for i in range(0,int(n/7)+1):
    j=0
    while 4*j + 7*i <= n:
      if 4*j + 7*i ==n:
        flg=1
      j+=1
  if flg==1:
    print('Yes')
  else:
    print('No')
main()

Solution (Python):
N = int(input())
for n in range(N+1):
  if n%4==0 and (N-n)%7==0:
    print("Yes")
    break
else:
  print("No")

Solution (Python):

def f(n):
	for i in range(0, n/4 + 1):
		for j in range(0, n / 7 + 1):
			if 4*i + 7 * j == n:
				return True

	return False
print 'Yes' if f(int(raw_input())) else 'No'

Solution (Python):
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')

Solution (Python):
import sys

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

N = I()

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

Solution (Python):
x = int(input())

flag = False
for ia in range(0, int(x/4) + 1):
    for ib in range(0, int(x/7) + 1):
        if 4 * ia + 7 * ib == x:
            flag = True
            break
    if flag:
        break

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

Solution (Python):
N = int(input())
k = 0

for i in range(0, 26, 1):
  for j in range(0, 16, 1):
    if i * 4 + j * 7 == N:
      print('Yes')
      k = 1
      break
  if k == 1:
    break
else:
  if k != 1:
    print('No')

Solution (Python):
n=int(input())
a=[False]*(n+10)
a[0]=True
for i in range(n+1):
  if a[i]:
    a[i+4]=True
    a[i+7]=True
if a[n]:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
n = int(input())
cake = 4
donut = 7
for i in range(25):
    for j in range(15):
        if cake*i+donut*j == n:
            print("Yes")
            sys.exit()
print("No")

Solution (Python):
n = int(input())

l = [0] * 10000
for i in range(0, 100 + 1):
  for j in range(0, 100 + 1):
    
    val = (4 * i) + (7 * j)
    
    l[val] += 1


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

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

for n in range(25):
  for m in range(25):
    if n*4+m*7==N:
      print("Yes")
      exit()
      
print("No")

Solution (Python):
N =int(input())
flag = False
for i in range(N):
    for j in range(N):
        if(4*i+7*j==N):
            flag=True
            break
    if(flag):
        break
if(flag):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = N // 4 + 1
    B = N // 7 + 1

    for a in range(A):
        for b in range(B):
            if a * 4 + b * 7 == N:
                print('Yes')
                exit()
    else:
        print('No')


if __name__ == '__main__':
    main()

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

P = [(a,b) for a in range(N//4+1) for b in range(N//7+1) if 4*a + 7*b == N]

print('No' if len(P)==0 else 'Yes')

Solution (Python):
N = int(input())
ans = "No"
for x in range(26):
    for y in range(15):
        if x * 4 + y * 7 == N:
            ans = "Yes"
            break

print(ans)

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

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

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

Solution (Python):
def solve():
    N = int(input())
    a = [1, 2, 3, 5, 6, 9, 10, 13, 17]
    if N in a:
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    solve()

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

Solution (Python):
n = int(input())
ans = 0
for i in range(n//7+1):
    if (n-i*7)%4 == 0:
        ans = 1
        break
print(["No","Yes"][ans])

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

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

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

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

Solution (Python):
n=int(input())
ans=0
for i in range(25):
  for j in range(14):
    if 4*i + 7*j ==n:
      ans=1
print("Yes" if ans==1 else "No")

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())
ans = False
for i in range(0, min(15, n // 7 + 1)):
    if (n - 7 * i) % 4 == 0:
        ans = True
print("Yes" if ans else "No")

Solution (Python):
n = int(input())

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

print('No')

Solution (Python):
n=int(input())


a=0
for i in range(0,n):
    for j in range(0,n):
        if 4*i+7*j==n:
            a+=1


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

Solution (Python):
import sys
N = int(input())
if not ( 1 <= N <= 100 ):
    sys.exit()

for I in range(N // 4 + 1):
    for J in range(N // 7 + 1):
        if 4 * I + J * 7 == N:
            print('Yes')
            sys.exit()
print('No')

Solution (Python):
n=int(input())
exist=False
for i in range(n):
  for j in range(n):
    if 4*i+7*j==n:
      print("Yes")
      exist=True
    if exist:
      break
  if exist:
    break
if not exist:
  print("No")

Solution (Python):
n = int(input())

c = 0
d = 0

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

Solution (Python):
n=int(input())
res = "No"
for sum in range(1,26):
    for j in range(sum+1):
        a=j
        b=sum-j
        if a*4 + b*7 ==n:
            res="Yes"
            break
print(res)

Solution (Python):

n = int(input())

ans = False

for j in range(25):  
        for k in range(15):  
            if j + k == 0:
                continue
            if n % ((j * 4) + (k * 7)) == 0:
                ans = True
                break
        if ans:
            break

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

Solution (Python):
n = int(input())

answer = False
for num_4 in range(n//4+1):
  if (n-num_4*4)%7 == 0:
    answer = True 
    break

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

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



max_CA = int(N / 4) + int(N % 4) 
max_CB = int(N / 7) + int(N % 7)




flag = False
for i in range(max_CA +1):
    for j in range(max_CB+1):
        sum_C = 4 * i + 7 * j
        if N == sum_C:
            flag = True
            
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
ans = 0
for i in range(26):
    for k in range(15):
        if ( 4*i + k*7 ) == N:
            ans = 1
            break
print("Yes" if ans == 1 else "No")

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

for i in range(100):
    for j in range(100):
        if i*4+j*7 == N:
            print("Yes")
            exit()

print("No")

Solution (Python):
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)

Solution (Python):
n = int(input())
for i in range(0, n+1, 7):
    for j in range(0, n+1, 4):
        if i + j == n:
            print('Yes')
            exit()
print('No')

Solution (Python):
N=int(input())
a=set(4*x+7*y for x in range(200) for y in range(200))
ans="Yes" if N in a else "No"
print(ans)

Solution (Python):
N=int(input())
ans=False
for i in range(100):
    for j in range(100):
        if 4*i+7*j==N:
            ans=True
out="Yes" if ans else "No"
print(out)

Solution (Python):
N = int(input())
div, mod = divmod(N, 7)
flag = False
for x in range(0, 100, 4):
    for y in range(0, 100, 7):
        if x + y == N:
            flag = True
            break
if flag:
    print("Yes")
else:
    print("No")

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

for i in range(26):
  for j in range(15):
    if (4*i + 7*j == N):
      print("Yes")
      exit()
else:
  print("No")

Solution (Python):
n = int(input())

ans = 'No'
for i4 in range(26):
  for i7 in range(15):
    if i4*4 + i7 *7 - n == 0:
      ans = 'Yes'
      break
    else:
      continue

print(ans)

Solution (Python):
N=int(input())
ans="No"
for i in range(26):
    for j in range(16):
        if 4*i+7*j==N:
            ans="Yes"
            break

print(ans)

Solution (Python):
n=int(input())

n_a=n//4
n_b=n//7

ans="No"
for i in range(n_a+1):
    for j in range(n_b+1):
        if 4*i+7*j==n:
            ans="Yes"
            break
        
print(ans)

Solution (Python):
N = int(input())
flag = sum([i+j==N for i in range(0,N+1,4) for j in range(0,N+1,7)])
print("Yes" if flag>0 else "No")

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

Solution (Python):
N = int(input())
for i in range(26):
    for j in range(15):
        if (4*i+7*j) == N:
            print("Yes")
            exit(0)

print("No")

Solution (Python):
N = int(input())
l = []
for i in range(25):
    for j in range(25):
        l.append(i * 4 + j * 7)
ans = 'No'
if N in l:
    ans = 'Yes'
print(ans)

Solution (Python):
n = int(input())

for i in range(15):
    n = n - 7*i
    if n < 0:
        print("No")
        exit()
    elif n % 7 == 0 or n % 4 == 0:
        print("Yes")
        exit()

Solution (Python):
buy = [False]*1000
buy[0] = True
for i in range(100):
  if buy[i]:
    buy[i+4] = True
    buy[i+7] = True
    
n = int(input())
if buy[n]:
  print("Yes")
else:
  print("No")

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

Solution (Python):
n = int(input())
for c in range(26):
  for d in range(16):
    if 4 * c + 7 * d == n:
      print('Yes')
      exit()
print('No')

Solution (Python):
n = int(input())

ans = []
for i in range(n//4+1):
    for j in range(n//7+1):
        if 4*i+7*j <= n:
            ans.append(4*i+7*j)
if ans.count(n) != 0:
    print('Yes')
else:
    print('No')

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

for i in range(100):
    for j in range(100):
        if i * 4+j*7 == N:
            print("Yes")
            exit()

print("No")

Solution (Python):
n = int(input())
for i in range(0,26):
    for j in range(0,15):
        if 4*i+7*j==n:
            print("Yes")
            exit()
print("No")

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

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

Solution (Python):
N = int(input())
x = int(N / 7)

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

Solution (Python):
n = int(input())
flag = False
for a in range(int(n / 7) + 1):
  for b in range(int(n / 4) + 1):
    if 7 * a + 4 * b == n:
      flag = True

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

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

Solution (Python):
import sys

input = sys.stdin.readline


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

    ans = "No"
    while N >= 0:
        if N % 4 == 0:
            ans = "Yes"
            break
        N -= 7

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    
    if n < 4:
        print("No")
        sys.exit()
        
    if n%4 == 0 or n%7 == 0:
        print("Yes")
        sys.exit()

    while(n > 0):
        n -= 7
        if n%4 == 0:
            break

    if n >= 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

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

a = N // 7

for i in range(a+1):
  b = N - i * 7
  if b%4 == 0:
    print('Yes')
    break
  else:
    continue
else:
  print('No')

Solution (Python):
def actual(N):
    
    
    
    
    n_max_cakes = N // 4
    n_max_donuts = N // 7

    for n_cakes in range(n_max_cakes + 1):
        for n_donuts in range(n_max_donuts + 1):
            price = (4 * n_cakes) + (7 * n_donuts)

            if price == N:
                return 'Yes'

    return 'No'

N = int(input())
print(actual(N))

Solution (Python):
def actual(N):
    oks = []

    for idx, n in enumerate(range(4, 104, 4), start=1):
        for i in range(idx + 1):
            satisfied_value = n + (3 * i)

            if satisfied_value <= 100:
                oks.append(satisfied_value)

    oks = sorted(set(oks))

    if N in oks:
        return 'Yes'

    return 'No'
  
N = int(input())
print(actual(N))

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

"""
4k = N - 7n
"""
for i in range(15):
    k = (N-(7*i)) / 4
    if k % 1 == 0 and k >= 0:
        print("Yes")
        break
    if i == 14:
        print("No")

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

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

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

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

Solution (Python):
import sys
N = int(input())
for i in range(50):
  for j in range(30):
    if i*4 + j*7 == N:
      print("Yes")
      sys.exit()
print("No")

Solution (Python):
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)

Solution (Python):
x = int(input())
flag = False
for i in range(26):
  left = x-4*i
  if left>=0 and left%7==0:
    flag=True
    break
if flag:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
print('Yes' if sum(4 * x + 7 * y == N for x in range(N//4 + 1) for y in range(N//7 + 1)) > 0 else 'No')

Solution (Python):


N = int(input())

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

Solution (Python):
n = int(input())

for i in range(101):
    for j in range(101):
        if 4*i + 7*j == n:
            print("Yes")
            exit()
        
        if 4*i + 7*j > n:
            break

print("No")

Solution (Python):
n = int(input())
for i in range(n//4+1):
    if n-4*i < 0:
        print("No")
        quit()
    elif (n-4*i)%7 == 0:
        print("Yes")
        quit()
print("No")

Solution (Python):
n = int(input())
count = 0
for i in range(16):
  if count:
    break
  if n - i * 7 == 0:
    print('Yes')
    count = 1
    break
  for j in range(26):
    if n - i * 7 - j * 4 == 0:
      print('Yes')
      count = 1
      break
if not(count):
  print('No')

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())


def ok():
    x = 0
    while x * 4 <= N:
        if (N - x * 4) % 7 == 0:
            return True
        x += 1
    return False

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

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

Solution (Python):
N = int(input())
ans = 0
for cake in range(N+1):
    for donut in range(N+1):
        if 4*cake + 7*donut == N:
            ans +=1
print('Yes' if ans>0 else 'No')

Solution (Python):
n = int(input())

ns = set()
for i in range(0, 26):
    for j in range(0, 16):
        ns.add(4*i + 7*j)
if n in ns:
    print('Yes')
else:
    print('No')

Solution (Python):
n=int(input())
for c in range(26):
    for d in range(15):
        if c*4+d*7==n:
            print('Yes')
            exit()
print('No')

Solution (Python):
N=int(input())
for c in range(100//4+1):
  for d in range(100//7+1):
    if c*4+d*7==N:
      print("Yes")
      exit()
print("No")

Solution (Python):
N = int(input())
List = []
for c in range(100//4 + 1):
  for d in range((100-4*c)//7 + 1):
    if 4*c + 7*d == N:
      List.append(c+d)
    else:
      continue
if bool(List) == True:
  print("Yes")
else:
  print("No")

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

Solution (Python):
n = int(input())
if n == 4 or n == 7 or n == 8 or n == 11 or n == 12 or n == 14 or n == 15 or n == 16 or n == 18 or n == 19 or n == 20 or n == 21 or n == 22 or n == 23 or n == 24 or n == 25 or n == 26 or n == 27 or n == 28 or n == 29 or n == 30 or n == 31 or n == 32 or n == 33 or n == 34 or n == 35 or n == 36 or n == 37 or n == 38 or n == 39 or n == 40 or n == 41 or n == 42 or n == 43 or n == 44 or n == 45 or n == 46 or n == 47 or n == 48 or n == 49 or n == 50 or n == 51 or n == 52 or  n == 53 or n == 54 or n == 55 or n == 56 or n == 57 or n == 58 or n == 59 or n == 60 or n == 61 or n == 62 or n == 63 or n == 64 or n == 65 or n == 66 or n == 67 or n == 68 or n == 69 or n == 70 or n == 71 or n == 72 or n == 73 or n == 74 or n == 75 or n == 76 or n == 77 or n == 78 or n == 79 or n == 80 or n == 81 or n == 82 or n == 83 or n == 84 or n == 85 or n == 86 or n == 87 or n == 88 or n == 89 or n == 90 or n == 91 or n == 92 or n == 93 or n == 94 or n == 95 or n == 96 or n == 97 or n == 98 or n == 99 or n == 100:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
if n == 1 or n == 2 or 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")

Solution (Python):
n = int(input())
flag = False
for t in range(0,25):
    for i in range(0,15):
        if t !=0 or i != 0:
            if t*4 + i*7==n:
                flag = True
if flag :
    print("Yes")
else :
    print("No")

Solution (Python):
N = int(input())
flg = False
i = 0
while 7 * i <= N:
    j = 0
    while 7 * i + 4 * j <= N:
        if 7 * i + 4 * j == N:
            flg = True
            break
        j += 1
    if flg:
        break
    i += 1
if flg:
    print('Yes')
else:
    print('No')

Solution (Python):
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") 

def main():
    n = int(input())
    if not (n%4) or not(n%7):
        print("Yes")
        return
    for i in range(4,n,4):
        for j in range(7,n,7):
            
            if n < i+j:
                continue
            elif n == i+j:
                print("Yes")
                return
    print("No")
    return



if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
x=n//4
y=n//7
c=0
for i in range(x+1):
    for j in range(y+1):
        if 4*i+7*j==n:
            c+=1
            
if c>0:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    for b in range(N // 7, -1, -1):
        a = N - 7 * b
        if a % 4 == 0:
            print("Yes")
            return
    print("No")


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
arr = []

for i in range(0,1+100//4):
  for j in range(0,1+100//7):
    if 4*i + 7*j <= 100:
      arr.append(4*i+7*j)

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

Solution (Python):
n=int(input())

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

Solution (Python):
n=int(input())

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

Solution (Python):
n = int(input())

ans = 0
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")

Solution (Python):

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

Solution (Python):
import sys


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

    for a in range(N // 4 + 1):
        for b in range(N // 7 + 1):
            if a * 4 + b * 7 == N:
                print("Yes")
                sys.exit()

    print("No")


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
for q in range(0, n, 7):
    if q == 0:
        continue
    if (n - q) % 4 == 0:
        print("Yes")
        exit(0)
print("No" if (n % 4 != 0) and (n % 7 != 0) else "Yes")

Solution (Python):
n = int(input())

def dfs(x):
  if x > n: return
  if x == n: print("Yes"), exit(0)
  dfs(x + 4)
  dfs(x + 7)

dfs(0)
print("No")