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())




cnt = "No"

if n % 4 == 0:
  cnt = "Yes"
  
if n % 7 == 0:
  cnt = "Yes"
  

for i in range(1,14):
  if( 7 * i > n ):
    break
  else:
    if( (n-7*i) % 4 == 0):
      cnt = "Yes"
      break
      
print(cnt)

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

flag = False

for i in range(26):
    for j in range(16):
        if 4*i + 7*j == n:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN




N=int(input())

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

Solution (Python):
import queue

ok_list = set()

q = queue.Queue()
q.put(0)
while not q.empty():
    current = q.get()
    for i in [4, 7]:
        n = current + i
        if n > 100:
            continue
        elif n in ok_list:
            continue
        else:
            ok_list.add(n)
            q.put(n)

n = int(input())
if n in ok_list:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
a = "No"
b = 1
for i in range(21) :
    for j in range(15) :
        if 4 * i + 7 * j == N :
            a = "Yes"
            b = 0
            break
    if b == 0 :
        break
print(a)

Solution (Python):
N = int(input())
cake = N // 4
donuts = N // 7
calcs = False
for i in range(cake + 1):
  for j in range(donuts + 1):
    if i * 4 + j * 7 == N:
      calcs = True
      break
print('Yes' if calcs is True else 'No')

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


n = int(sys.stdin.buffer.readline())
ok=False

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

Solution (Python):
import sys

cand = set()
for i in range(0, 20+1, 4):
    for j in range(0, 20-i+1, 7):
        cand.add(i + j)

n = int(sys.stdin.readline().rstrip())

def main():
    return 'Yes' if n in cand or n >= 21 else 'No'

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

Solution (Python):
import sys

cand = set()
for i in range(0, 100+1, 4):
    for j in range(0, 100-i+1, 7):
        cand.add(i + j)

n = int(sys.stdin.readline().rstrip())

def main():
    return 'Yes' if n in cand else 'No'

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 




N = int(input())

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

Solution (Python):
from math import ceil

N = int(input())
is_possible = False

for i in range((N//4)+1):
    for j in range((N//7)+1):
        if 4*i+7*j == N:
            is_possible = True
            break
    if is_possible:
        break

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

Solution (Python):
n = int(input())
lst_4 = [x for x in range(4, 101, 4)]
lst_7 = [x for x in range(7, 101, 7)]
lst = []
for i in lst_4:
    for j in lst_7:
        lst.append(i)
        lst.append(j)
        lst.append(i + j)

ans = [x for x in lst if x <= 100]
print('Yes' if n in ans else 'No')

Solution (Python):
N = int(input())
cake = N // 4
donuts = N // 7
calcs = False
for i in range(cake + 1):
  for j in range(donuts + 1):
    s = i * 4 + j * 7
    if s == N:
      calcs = True
      break
print('Yes' if calcs is True else 'No')

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

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

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

for i in range(len(dp)):
    if i < 4:
        continue
    elif dp[i-4] == True:
        dp[i] = True

    if i < 7:
        continue
    elif dp[i-7] == True:
        dp[i] = True


if dp[n]:
    print('Yes')
else:
    print('No')

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

Solution (Python):


n = int(input())

for i in range(n+1):
    d = 4 * i
    if d > n:
        break
    if (n - d) % 7 == 0:
        print("Yes")
        exit(0)

print("No")

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

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

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

Solution (Python):



N = int(input())

cake_max = N // 4
donut_max = N // 7

res = 'No'

for cake in range(cake_max+1):
    if cake * 4 == N:
        res = 'Yes'
        break
    for donut in range(donut_max+1):
        if (N - cake*4) % 7 == 0:
            res = 'Yes'
            break

print(res)

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):
def main():
    n = int(input())
    for i in range(n//7+1):
        if (n-7*i) % 4 == 0:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    main()

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

for i in range(0, 26):
    for j in range(0, 15):
        money = 4*i+7*j
        if(money == N):
            print("Yes")
            sys.exit()

print("No")

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

Solution (Python):
ans = 'No'

n = int(input())

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

print(ans)

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

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

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

Solution (Python):
import numpy as np
N = int(input())
cost_list = np.array((4,7))
dp = np.ones(N+1, dtype=np.bool) * False
dp[0] = True
for i in range(1,N+1):
    for j in range(len(cost_list)):
        cost = cost_list[j]
        if i - cost >= 0 and dp[i-cost]:
            dp[i] = True
            break

res = "Yes" if dp[N] else "No"

print(res)

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

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

print('No')

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

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

print("No")

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

ans = "No"
for i in range(100):
  for j in range(100):
    if i*4 + j*7 == N:
      ans = "Yes"
      break

print(ans)

Solution (Python):
n = int(input())
ans = "No"

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

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

for y in range(13):
    x = N - 7 * y
    if x >= 0 and x % 4 == 0:
        print("Yes")
        exit()
print("No")

Solution (Python):
import math
N = int(input())
for i in range(16):
    res = N - 7 * i
    if res < 0:
        break
    if res % 4 == 0:
        print('Yes')
        exit()
print('No')

Solution (Python):
no_list = [1,2,3,5,6,9,10,13,17]

N = int(input())

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

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

flag = 0

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

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

Solution (Python):

n = int(input())


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

print('No')

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

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

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
for i in range(20):
	for j in range(25):
		if(i == 0 and j == 0):
			continue
		if((i*7+j*4) == N):
			print("Yes")
			exit()
print("No")

Solution (Python):


"""
sample = []
for i in range(100):
    for j in range(100):
        sample.append(4*i + 7*j)

print(sample)
print("---")
print(set(sample))
"""

a = int(input())

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

if a in sample:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
i=0
while True:
    j=0
    if i*4+j*7>n:
        break
    while True:
        if i*4+j*7==n:
            print("Yes")
            exit()
        j+=1
        if i*4+j*7>n:
            break
    i+=1

print("No")

Solution (Python):
def main():
    n = int(input())
    while n >= 0:
        f = n % 4
        if f == 0:
            return "Yes"
        n -= 7
    return "No"


print(main())

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

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

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

Solution (Python):

n =int(input())

for i in range(16):
  s = n - (i*7)
  if s < 0:
    break
  if s%4==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())

A = 4
B = 7
max_num = N // 4 + 1
res = "No"
for i in range(max_num + 1):
    for j in range(max_num - i):
        if (A * i + B * j) == N:
            res = "Yes"
            break

print(res)

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

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

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

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

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

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

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

flg = False
for a in range(int(N / 4 + 1)):
    for b in range(int(N / 7 + 1)):
        if a * 4 + b * 7 == N:
            flg = True

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

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

flg = False
for a in range(N):
    for b in range(N):
        if a * 4 + b * 7 == N:
            flg = True

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

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

Solution (Python):
from sys import exit

N = int(input())

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

Solution (Python):
import sys
n=int(input())
while(n>=0):
    if(n%4==0):
        print("Yes")
        sys.exit()
    else:
        n-=7
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(0)
print("No")

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

ans = "No"
while n >= 0:
    if n%11 == 0 or n%4 == 0 or n%7 == 0:
        ans = "Yes"
        break

    n -= 4

print(ans)

Solution (Python):
n = int(input())
cake = 4
donut = 7
flag = False
for i in range(25):
  for j in range(25):
    num = n - i*cake - j*donut
    if num == 0:
      flag = True
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()
print("No")

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

Solution (Python):
x = int(input())
for i in range(25):
    for j in range(25):
        if 4*i+7*j == x:
            print("Yes")
            break
    else:
        continue
    break
else:
    print("No")

Solution (Python):
N = int(input())
def devide(n):
  if n < 4:
    return False
  elif n % 4 == 0:
    return True
  elif n % 7 == 0:
    return True
  else:
    return devide(n - 4) or devide(n - 7)

if devide(N):
  print("Yes")
else:
  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())
c = 1 
for i in range(N//7 + 1): 
        if (N - 7*i) % 4 == 0:
                c = 0 
                print("Yes")
                break
if c:
        print("No")

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

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


buy = False
break_flag  = False

for cake in range(25):
    for donatu in range(14):
        if 4*cake+7*donatu==N:
            buy = True
            break_flag=True
            break
    
    if break_flag:
        break

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

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

range_cakes = range((N//4)+1)
range_donuts = range((N//7)+1)

flag = False
for i in range_cakes:
  for j in range_donuts:
    if N - 4 * i - 7 * j == 0:
      flag = True
if flag:
	print("Yes")
else:
    print("No")

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

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

Solution (Python):
a = range(26)
b = range(15)
n = int(input())
ans = "No"

for i in a:
    for j in b:
        if 4*i + 7*j == n:
            ans = "Yes"

print(ans)

Solution (Python):
[print("Yes" if any(cake * 4 + donut * 7 == n for donut in range(n // 7 + 1) for cake in range(n // 4 + 1)) else "No") for n in [int(input())]]

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








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

Solution (Python):
n=int(input())
for i in range(26) :
  if  n >= 4*i and (n-(4*i))%7==0 :
    print("Yes")
    break
else :
  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())
for cake in range(26):
    for donuts in range(15):
        if cake * 4 + donuts * 7 == n:
            print('Yes')
            exit()
print('No')

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

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

q,r = divmod(n, 7)

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

if res > 0:
  print('Yes')
else:
  print('No')

Solution (Python):
n = int(input())
string = "No"
for i in range(n+1):
        for j in range(n+1):
            if n == 4*i + 7*j :
                string = "Yes"
                break

print(string)

Solution (Python):
n = int(input())
string = "No"
for i in range(1, n+1):
        for j in range(1, n+1):
            if n % (4 * i + 7 * j) == 0:
                string = "Yes"
                break
            elif n % (4 * i) == 0:
                string = "Yes"
                break
            elif n % (7 * j) == 0:
                string = "Yes"
                break

print(string)

Solution (Python):
n = int(input())
a4 = [4*i for i in range(n//4+1)]
a7 = [7*i for i in range(n//7+1)]

ans = 'No'
for x in a4:
    for y in a7:
        if x+y == n:
            ans = 'Yes'
            break
print(ans)

Solution (Python):
n = int(input())
print('Yes' if any(4*i+7*j==n for i in range(26) for j in range(15)) else '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())
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(0,n+1,4):
    if (n-i)%7==0:
        print("Yes")
        break
else:
    print("No")

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

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

    else:
        N -= 11

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

else:
    print("No")

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

ymx = n // 7

for y in range(0, ymx + 1):
    if (n - 7 * y) % 4 == 0:
        print("Yes")
        break
    elif y == ymx:
        print("No")

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

if N%4==0 or N%7==0:
    flag=True

maximum=N//4
minimum=N//7

for i in range(N//4):
    for j in range(N//7):
        if 4*(i+1)+7*(j+1)==N:
            flag=True
        else:
            continue

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

Solution (Python):
def examB():
    N = I()
    cur = "No"
    cake = N//4
    for i in range(cake+1):
        if (N-i*4)%7==0:
            cur = "Yes"
            break
    print(cur)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

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())

for y in range(15):
    x = N - 7 * y
    if x < 0:
        break
    if x % 4 == 0:
        print("Yes")
        exit()

print("No")

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

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

Solution (Python):
N=int(input())
for i in range(26):
  for j in range(14):
    if 4*i+7*j==N:
      print('Yes')
      break
  else:
    continue
  break
else:
  print('No')

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

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


for nc in range(N//4+1):
    res=N-(nc*4) 

    if res%7==0: 
        OKflag=True
        break

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

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

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

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

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

Solution (Python):
import sys


def main():
    N = int(input())
    M = N // 7

    for m in range(M+1):
        d = N - m * 7
        if d % 4 == 0:
            print('Yes')
            sys.exit()
    else:
        print('No')


main()

Solution (Python):
A = int(input())
Flag = False
for i in range((A//4)+1):
  for j in range((A//7)+1):
    if A == 3:
      break;
    elif 4*i + 7*j == A:
      Flag = True
if Flag:
  print('Yes')
else:
  print('No')

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

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

Solution (Python):

N = int(input())


a = N // 4
b = N // 7

flag = 0

for i in range(a + 1):
    for j in range(b + 1):
        if 4 * i + 7 * j == N:
            flag = 1
            break

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

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(N: int):
    ans = NO
    for i in range(int(100//4)):
        for j in range(int(100//7)):
            if 4*i + 7*j == N:
                ans = YES
                break
    print(ans)

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

if __name__ == '__main__':
    main()

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())
for i in range(N + 1):
    for j in range(N + 1):
        if (4 * i + 7 * j == N):
            print('Yes')
            exit()
print('No')

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

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

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

isYes=False
num=0
while (7*num<=N):
    if ((N-7*num)%4==0):
        isYes=True
        break
    num+=1

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

Solution (Python):
n = int(input())
s = set()
for n4 in range(26):
  for n7 in range(15):
    s.add(4 * n4 + 7 * n7)
if n in s:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n = INT()
    while n >= 0:
    	if n%4==0 or n%7==0:
    		print('Yes')
    		sys.exit()
    	n -= 11
    print('No')


if  __name__=='__main__':
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()

can = [0]*101
can[0] = 0

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

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

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):
N = int(input())

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

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

Solution (Python):
N = int(input())
cake = 4
donut = 7

for i in range((100//cake) + 1):
  is_break = False
  for j in range((100//donut) + 1):
    num = cake * i + donut * j
    if N == num:
      print('Yes')
      is_break = True
      break
  if is_break:
    break
else:
  print('No')

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

for i in range(26):
    for j in range(16):
        if i*4 + j*7 == n:
            print("Yes")
            sys.exit()

print("No")

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


l = []

for i in range(100//4+1):
	for j in range(100//7+1):
		l.append(4*i+7*j)


set(l)





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

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

for i in range(26):
  for j in range(14):
    if N == 4*i + 7*j:
      print("Yes")
      yes_flag = 1
      break
  if yes_flag == 1:
    break
else:
  print("No")

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

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

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

Solution (Python):

n = int(input())

can_buy = 'No'

for i in range(n // 4 + 1):
    
    for j in range(n // 7 + 1):

        if 4 * i + 7 * j == n:
            can_buy = 'Yes'
            break
    
    if can_buy == 'Yes':
        break

print(can_buy)

Solution (Python):
from sys import stdin

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

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

Solution (Python):
n = int(input())
b = [4, 7]
p = [0]

while 1:
	pt = []
	for i in range(len(p)):
		for j in range(2):
			if p[i]+b[j] < n:
				pt.append(p[i]+b[j])
			elif p[i]+b[j] == n:
				print("Yes")
				exit(0)
	if len(pt) == 0:
		print("No")
		exit(0)
	else:
		p = pt

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

Solution (Python):
import sys

def main():
  N = int(input())
  l = N // 4

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

  print('No')

main()

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())
a=n//7+1
flag=1
for i in range(a):
  if (n-7*i)%4==0:
    flag*=0
if flag==1:
  print('No')
else:
  print('Yes')

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

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

flg = False
for c in range(26):
    for d in range(15):
        if c*4 + d*7 == n:
            flg = True

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

Solution (Python):
n = int(input())
ans = False
for i in range(21):
  for j in range(15):
    if i * 4 + j * 7 == n:
      ans = True
      break

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