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):
N = int(input())
a = N//4
b = N//7
yes = 0
no = 0
for i in range(a+1):
  for l in range(b+1):
    if 4*i+7*l == N:
      yes = 1
    else:
      no = 1
if yes ==1:
  print("Yes")
else:
  print("No")

Solution (Python):
N=int(input())
result='No'
c=0
d=0
while c*4<=N:
  while c*4+d*7<=N:
    sum = c*4+d*7
    if c*4+d*7==N:
      result='Yes'
    d+=1
  c+=1
  d=0
print(result)

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

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

cnt = 0
for i in range(0, 200, 4):
    for j in range(0, 200, 7):
        if i + j == N:
            cnt += 1
if cnt:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys
N=int(input())
ans=0
for i in range(26):
  for k in range(15):
    if 4*i+7*k==N:
      print("Yes")
      sys.exit()
print("No")

Solution (Python):
n = int(input())
def lookfor(n):
  m4 = n//4+1
  m7 = n//7+1
  for i4 in range(m4):
    for i7 in range(m7):
      total = 4*i4 + 7*i7
      
      if total == n:
        print('Yes')
        return
      elif total > n:
        break  
  print('No')
  return

lookfor(n)

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()

for i in range(N // 4 + 1):
    for j in range(N // 7 + 1):
        if i * 4 + j * 7 == N:
            print('Yes')
            import sys
            sys.exit()

print('No')

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

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

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

print(ans)

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

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

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

count = 0

for i in range(100):
  for t in range(100):
    if N == 4*i + 7*t:
      count = count + 1

if count > 0:
  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')
        exit()
print('No')

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

def cake(cnt):
    if cnt == 0:
        return 1
    if cnt < 0:
        return 0
    
    return cake(cnt-4) or  cake(cnt-7)

if (cake(n) == 1):
    print("Yes")
else:
    print("No")

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

if n % 4 == 0 or n % 7 == 0:
  print('Yes')
else:
  canbuy = False
  while True:
    n = n - 7
    if n < 0:
      break
    if n % 4 == 0:
      canbuy = True
      break
  if canbuy:
    print('Yes')
  else:
    print('No')

Solution (Python):
import itertools
N = int(input())
pCake = range(N // 4 + 1)
pDonut = range(N // 7 + 1)

ptn = list(itertools.product(pCake, pDonut))

for i in ptn:
    if i[0] * 4 + i[1] * 7 == N:
        print('Yes')
        exit()

print('No')

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


abc()

Solution (Python):

N = int(input())

ans = "No"
while N >= 0:

    if N % 4 == 0:
        ans = "Yes"
        break

    N -= 7

print (ans)

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

p=0
for y in range(n//7+1):
  x=n/4 - 7*y/4
  if x.is_integer() == True and x>-1:
    p += 1
    break
  else:
    continue
if p == 1:
  print("Yes")
else:
  print("No")

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

fo = n // 4
se = n // 7

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

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

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

Solution (Python):

N = int(input())

max_4 = int(N / 4)
max_7 = int(N / 7)

yes = 0

for i in range(max_4+1):
    for j in range(max_7+1):
        if i*4 + j*7 == N:
            yes = 1
            break

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

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

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

Solution (Python):
se = set(4*x + 7*y for x in range(200) for y in range(200))
N = int(input())

answer = 'Yes' if N in se else 'No'
print(answer)

Solution (Python):
n = int(input())
if n%4 == 0 or n%7 == 0:
  print('Yes')
elif (n%4)%7 == 0 or (n%7)%4 == 0:
  print('Yes')
else:
  a = n // 4
  msg = 'No'
  for i in range(a):
    m = n - 4*i
    if m%7 == 0:
      msg = 'Yes'
      break
  print(msg)

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())
bool=False
for i in range(0,N+1,4):
    for j in range(i,N+1,7):
        if j == N:
            bool = True
            break
if bool and N!=0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")


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

ok = False
for i in range(50):
    for j in range(25):
        ok |= 4*i + 7 *j == N

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

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

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

a = n // 4
b = n // 7

for i in range(a+1):
        for j in range(b+1):
                if ((i * 4) + (j * 7)) == n:
                        print("Yes")
                        quit()

print("No")

Solution (Python):

n = int(input())


answer = "No"
flags = [0 for i in range(101)]
cake = 4
dunut = 7

if (n % 7 == 0):
  answer = "Yes"
else:
  for i in range(4, 101, 4):
    flags[i] = 1
    for j in range(i, 101, 7):
      flags[j] = 1
  if (flags[n] == 1):
    answer = "Yes"



print(answer)

Solution (Python):
n = int(input())
ans = 0
for i in range((n//4)+1):
    for j in range((n//7)+1):
        sum_price = 4 * i + 7 * j
        if sum_price == n:
            ans = 1
            
if ans == 1:
    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")
    exit()
print("No")

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


ans=False

if n%7==0:
    ans=True


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

if ans:
    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()
print('No')

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

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

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

Solution (Python):
n = int(input())
max_f = int(n / 4)
max_s = int(n / 7)
switch = 0
for i in range(max_s + 1):
    for j in range(max_f + 1):
        if (7 * i + 4 * j) == n:
            switch = 1
if switch == 1:
    print("Yes")
else:
    print("No")

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

cake = 4
donut = 7
flg = False

for cake_num in range(N // cake + 1):
    for donut_num in range(N // donut + 1):
        sum = cake * cake_num + donut * donut_num

        if sum == N:
            flg = True

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

Solution (Python):
N = int(input())
 
CAKE_PRICE = 4
DONUT_PRICE = 7
 
flag = 0
for cake_num in range(N//CAKE_PRICE + 1):
  for donut_num in range(N//DONUT_PRICE + 1):
    sum_price = CAKE_PRICE * cake_num + DONUT_PRICE * donut_num
    if sum_price == N:
   		flag = 1
  
if flag == 0:
  print("No")
else:
  print("Yes")

Solution (Python):
n=int(input())
if n%4==0 or n%7==0:
  print("Yes")
elif n<7:
  print("No")
else:
  d=n
  c=0
  while d>=7:
    d=d-7
    c+=1
  if d>=4:
    d=d-4
  if d<=c:
    print("Yes")
  else:
    print("No")

Solution (Python):
N=int(input())
upper_cake=N//7
upper_d=N//4
flag=False
for i in range(upper_cake+1):
        for j in range(upper_d+1):
                if 7*i+4*j==N:
                        flag=True
                        break

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

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

Solution (Python):
n = int(input())
cake_p = 4
donuts_p =7
cake = [i*cake_p for i in range((100//cake_p)+1)]
donuts = [i*donuts_p for i in range((100//donuts_p)+1)]

ans='No'
for i in cake:
  for x in donuts:
    if i+x==n:
      ans='Yes'

      
if ans=='Yes':
  print('Yes')
else:
  print('No')

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

Solution (Python):
import sys

n = int(input())

ans = 0

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

Solution (Python):
import sys
N = int(input())
for i in range(1,N):
    for j in range(0,100,7):
        for k in range(0,100,4):
            if j + k == N:
                print('Yes')
                sys.exit()
            elif j + k > N:
                break
print('No')

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

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

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

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

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

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

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

flg = "No"
for i in range(26):
    for j in range(15):
        if 4*i+7*j==n:
            flg = 'Yes'
            break
        else:
            pass
        
print(flg)

Solution (Python):
def main(N):
  
    CP = 4
    DP = 7
    
    if N <= 3:
        return "No"
    
    for i in range(100):
        for j in range(100):
            if (CP * i + DP * j) == N:
                return "Yes"
    return "No"
N = int(input())
print(main(N))

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

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

for i in range(n // 4 + 1):
    for j in range(n // 7 + 1):
        if i * 4 + j * 7 == n:
            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):
num=[]
for i in range(26):
  for j in range(15):
    if 4*i+7*j<=100:
      num.append(4*i+7*j)
n=int(input())
if n in num:
  print("Yes")
else:
  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())
a=0
for i in range(26):
    for j in range(16):
        if 4*i+7*j==n:
            a+=1
print("Yes" if a>=1 else "No")

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

Solution (Python):

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

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

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

print(ans)

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

x=n//4
y=n//7

print("Yes" if len([n-4*a-7*b for b in range(y+1) for a in range(x+1) if n-4*a-7*b==0])!=0 else "No")

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

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

c_max = N //4
d_max = N //7

for i in range(c_max+1):
    for j in range(d_max+1):
        temp = 4*i + 7*j

        if temp == N:
            print("Yes")
            exit()
print("No")

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

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

def cakes_and_donuts(N=N):
  if N % 4 ==0 or N % 7 ==0:
    return 'Yes'  
  max_7_num = N//7
  max_4_num = N//4
  for i in range(max_7_num):
    for j in range(max_4_num):
      if 7*(i+1) + 4*(j+1) == N:
        return 'Yes'
  return 'No'

s = cakes_and_donuts(N)
print('{}'.format(s))

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

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

if n < 0:
    print("No")

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

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

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

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

Solution (Python):
n = int(input())
dp = [False] * (n + 1)
dp[-1] = True

for i in list(range(n + 1))[::-1]:
  if (i + 4) <= n:
    if dp[i + 4] == True:
      dp[i] = True
  if (i + 7) <= n:
    if dp[i + 7] == True:
      dp[i] = True

if dp[0] == True:
  print('Yes')
else: 
  print('No')

Solution (Python):
n=int(input())
ans=0
for i in range(30):
    for j in range(20):
        if 4*i+7*j==n:
            print('Yes')
            ans+=1
            break
        if ans==1:
            break
    if ans==1:
        break

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

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

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

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

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

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

for i in range(26):
	for j in range(15):
		if (4 * i + 7 * j) == N:
			ans = 'Yes'

print(ans)

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

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

Solution (Python):
N = int(input())
 
cake = 4
dou = 7
dec = False
 
for i in range(26):
    for j in range(15):
        price = cake * i + dou * j
        if price == N:
            dec = True

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

Solution (Python):
n =int(input())
for i in range(16):
    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((N//7)+1):
    total = i*7
    while total < N:
        total += 4
    if total == N:
        print('Yes')
        exit()
print('No')

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

y = False
for cake in range(50):
    for donut in range(15):
        price = cake * 4 + donut * 7
        if price == n:
            print('Yes')
            y = True
            break
        elif price > 100:
            continue
    else:
        continue
    break
if not y:
    print('No')

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

Solution (Python):

N=int(input())

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


print('No')

Solution (Python):

N=int(input())

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


print('No')

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

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np

def main():
	
	N = int(input())
	
	s4 = []
	s7 = []
	for i in range(101):
		if i % 4 == 0:
			s4.append(i)
		if i % 7 == 0:
			s7.append(i)
			
	if N % 4 == 0 or N % 7 == 0:
		print("Yes")
		sys.exit()
		
	tmp = []
	for i in s7:
		for j in s4:
			if i + j == N:
				print("Yes")
				sys.exit()
			
	print("No")
	
	
	
if __name__ == "__main__":
	main()

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

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

c=0
for i in range(26):
    for j in range(13):
        if i*4+j*7==N:
            print("Yes")
            sys.exit()
print("No")

Solution (Python):
N = int(raw_input())
flag = False
for i in range(0, 26):
	for j in range(0, 15):
		if 4*i + 7*j == N: flag = True
if flag: print 'Yes'
else: print 'No'

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

for i in range(26):
    for j in range(16):
        l.append(i*4+j*7)

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

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

for i in range(0, 25):
    for j in range(0, 14):
        if n - 4*i - 7*j == 0:
            print("Yes")
            exit()

print("No")

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

money = 0
c = int((N + (4 - 1)) / 4)
d = int((N + (7 - 1)) / 7)

for i in range(c+1):
    for j in range(d+1):
        if (i * 4) + (j * 7) == N:
            print('Yes')
            exit()
print('No')

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

Solution (Python):
n=int(input())
if n%4==0:
    print("Yes")
elif n%4==3 and n>=7:
    print("Yes")
elif n%4==2 and n>=14:
    print("Yes")
elif n%4==1 and n>=21:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
N = int(input())
y = 0
while N >= 7*y:
    if (N - 7*y) % 4 ==0:
        print('Yes')
        break
    y += 1
else:print('No')

Solution (Python):
answer=0
a=int(input())

for i in range(a):
    for j in range(a):
        sum=i*4+j*7
        if sum==a:
            answer+=1
if answer>0:
    print("Yes")
else :
    print("No")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(N: int):

    for i in range(0,N//4+1):
        for j in range(0,N//7+1):
            if (4*i + 7*j) ==  N:
                print(YES)
                return

    print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

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

    pattern_num = 0
    for cake_num in range(N//4 + 1):
        for dotat_num in range(N//7 + 1):
            total_price = 4 * cake_num + 7 * dotat_num
            if total_price == N:
                pattern_num += 1

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

Solution (Python):
n = int(input())
print('Yes' if n > 3 and (
    (n % 4 == 0) or (n >= 7 and (n - 7) % 4 == 0) or
    (n >= 14 and (n - 14) % 4 == 0) or (n >= 21 and (n - 21) % 4 == 0)
) else 'No')

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

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]

    dp = [0] * 101

    dp[0] = 1
    for i in range(1,101):
        if i-4>=0 and dp[i-4]>0:
            dp[i] = dp[i-4]
        if i-7>=0 and dp[i-7]>0:
            dp[i] = dp[i-7]
    
    if dp[n]:
        print('Yes')
    else:
        print('No')

solve()

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

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

cake = 0
answer = 'No'
while cake * 4 <= N:
    if (N - (cake * 4)) % 7 == 0:
        answer = 'Yes'
        break
    cake += 1

print(answer)

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

m_cake = N // 4
a = 0

for i in range(m_cake + 1):
    m_donuts = (N - 4 * i) % 7
    if m_donuts == 0:
        a = 1

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

Solution (Python):

"""
B - Cakes and Donuts
https://atcoder.jp/contests/abc105/tasks/abc105_b

"""
import sys


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


def main(args):
    N = int(input())
    ans = solve(N)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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


n = int(input())
print(str(answer(n)))

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

for a in range(N+1):
    if a%4 == 0 and (N-a)%7 == 0:
        print ('Yes')
        sys.exit()
print ('No')

Solution (Python):
from sys import stdin
import math

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

for k in range(math.floor(N / 7) + 1):
    if (N - 7 * k) % 4 == 0:
        print('Yes')
        break
    if k == math.floor(N / 7):
        print('No')

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

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

for i in range(n // 4 + 1):
    for j in range((n - 4 * i) // 7 + 1):
        if i * 4 + j * 7 == n:
            print("Yes")
            sys.exit(0)

print("No")

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

check = 0
for n in range(N // 4 + 1):
    if (N - 4 * n) % 7 == 0:
        check = 1
        break

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

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

Solution (Python):
import sys
N = int(input())
for i4 in range(N):
  for i7 in range(N):
    if i4 * 4 + i7 * 7 == N:
      print("Yes")
      sys.exit(0)
print("No")

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

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

print(ans)

Solution (Python):
import sys
N = int(input())
tmp4 = N//4+1
tmp7 = N//7+1


for i in range(tmp4):
    for j in range(tmp7):
        Buy  = 4*i+7*j
        if N ==Buy:
            print('Yes')
            sys.exit()

print('No')

Solution (Python):
import sys
input = sys.stdin.readline

x=int(input())

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

Solution (Python):
import sys
input = sys.stdin.readline

x=int(input())

for i in range(101):
  for j in range(101):
    if x == (4*i + 7*j):
      print("Yes")
      sys.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):
N = int(input())
ans = False
for i in range(int(N/7)+1):
    if  (N - 7 * i) % 4 == 0:
        ans = True
if ans == True:
    print('Yes')
else:
    print('No')

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

Solution (Python):

divisors = [4+i*7 for i in range(4)]
bound_num = max(divisors)
n = int(input())
yes=[i*4 + j*7 for i in range(6) for j in range(6)]
if n >= bound_num or n in yes:
    print("Yes")
else:
    print("No")

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(N: int):
    ret = NO
    for i in range(N):
        if (N - 4 * i) >= 0 and (N - (4 * i)) % 7 == 0:
            ret = YES
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

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

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

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


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


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance





def main():
    n = intin()

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

    print('No')


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
n=int(input())
aa=[4*n+7*m for n in range(1+100//4) for m in range(1+100//7) if 4*n+7*m <= 100]
print('Yes' if n in aa else 'No')

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