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())
ans =0
for i in range(25):
    for j in range(int(100/7)):
        if(i*4+j*7 ==N):
            ans +=1
if(ans >0):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
N = int(input())
N2 = N
while(N >= 0):
  if N%4 == 0 or N%7 == 0:
    print('Yes')
    sys.exit()
  else:
    N -=4
while(N >= 0):
  if N%4 == 0 or N%7 == 0:
    print('Yes')
    sys.exit()
  else:
    N -=7
print('No')

Solution (Python):
N=int(input())
c=0
for i in range(N+1):
  if i%4==0 and (N-i)%7==0:
    c=1
print('Yes' if c==1 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):
PRICE_CAKE = 4
PRICE_DOUGHNUT = 7

n = int(input())
max_cakes = n // PRICE_CAKE

valid = False
for i in range(max_cakes + 1):
  n_left = n - i * PRICE_CAKE
  if n_left % PRICE_DOUGHNUT == 0:
    valid = True
    break
    
print("Yes" if valid else "No")

Solution (Python):
n = int(input())
flag = 0
for i in range(15):
  for j in range(26):
    if 7*i + 4*j == n:
      flag = 1
      exit

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

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

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

Solution (Python):
n = int(input())
for i in range(100 // 7 + 2):
  if (n - i * 7) < 0:
    print("No")
    break
  if (n - i * 7) % 4 == 0:
    print("Yes")
    break
else:
  ptint("No")

Solution (Python):
n=int(input())
ans=False
for i in range(100//4+1):
  if 4*i>n:
    break
  for j in range(100//7+1):
    if 4*i+7*j>n:
      break
    elif 4*i+7*j==n:
      ans=True
      break
    
print(("No","Yes")[ans])

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

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

Solution (Python):
N = int(input())
a = 4
b = 7
count = 0
for i in range(0, (N // a) + 1):
    for j in range(0, (N // b) + 1):
        if a * i + b * j == N:
            count += 1
        else:
            pass

if count >= 1:
    print('Yes')
else:
    print('No')

Solution (Python):
n = int(input())
A = -(-n//4)
B = -(-n//7)
for a in range(A+1):
    for b in range(B+1):
        if a*4 + b*7 == n:
            print('Yes')
            break
    else:
        continue
    break
else:
    print('No')

Solution (Python):
N=int(input())
flg=False
m=N//4
for a in range(0,m+1):
    for b in range(0,m+1):
        L=a*4+b*7
        if L==N:
            flg=True
if flg:
    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 = 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):
from math import floor
import sys
n = int(input())

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

print("No")

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

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

print('No')

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

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

Solution (Python):
print('Yes' if [4 * i + 7* j for i in range(101) for j in range(101)].count(int(input())) else 'No')

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

print(flag)

Solution (Python):
N = int(input())
L=[4*x+7*y for x in range(26) for y in range(15)]
print("Yes" if N in L else "No")

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

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

Solution (Python):
n = int(input())
a = n // 4
b = n // 7
flg = False

for i in range(a + 1):
  for j in range(b + 1):
    y = i * 4 + j * 7
    if y == n:
        flg = True
        
if flg:
  print('Yes')
else:
  print('No')

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

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

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



counter = 0
for a in range(N//4+1):
  for b in range(N//7+1):
    if 4*a + 7*b == N:
      counter += 1

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

Solution (Python):
n = int(input())
print("Yes" if len([1 for i in range(100//4) for j in range(100//7) if i*4+j*7==n])>0 else "No")

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

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

flag = 0

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

Solution (Python):
N = int(input())
ans_list = []
for f in range(26):
    for s in range(15):
        ans_list.append(4 * f + 7 * s)

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

Solution (Python):
N = int(input())
cake = 7
donut = 4
count = 0
for i in range(16):
    for j in range(26):
        if N == cake*i + donut*j:
            count = count + 1
        else:
            continue

if count > 0:
    print('Yes')
elif count == 0:
    print('No')

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

Solution (Python):
dp = [0 for i in range(100)]
dp[6] = 1
dp[3] = 1
for i in range(100):
  if i>=4 and dp[i-4]==1:
    dp[i] = 1
  if i>=7 and dp[i-7]==1:
    dp[i] = 1
if dp[int(input())-1]==1:
  print("Yes")
else:
  print("No")

Solution (Python):
n = int(input())
c = 25
d = 14
judge = "No"

for i in range(d + 1):
  for j in range(c + 1):
    payment = 7 * i + 4 * j
    if payment == n:
      judge = "Yes"

print(judge)

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

Solution (Python):
N=int(input())
print('Yes' if [4*x+7*y for x in range(N) for y in range(N)].count(N)>0 else '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())

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

print("No")

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

for i in range(4, N + 1, 4):
    d = N % i
    if d == 0:
        print("Yes")
        exit()

    if d % 7 == 0:
        print("Yes")
        exit()

for i in range(7, N + 1, 7):
    d = N % i
    if d == 0:
        print("Yes")
        exit()

    if d % 4 == 0:
        print("Yes")
        exit()

print("No")

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

Solution (Python):
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        for d in range(N//7 + 1):
            for c in range(N//4 + 1):
                if d*7 + c *4 == N:
                    print('Yes')
                    exit()
        print('No')



if __name__ == '__main__':
    AtCoder().main()

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

cash_cake = 4
cash_donut = 7

for cake in range(0,26):
  for donut in range(0,15):
    payment = cake*cash_cake + donut*cash_donut
    if payment == N:
      print('Yes')
      exit()

print('No')

Solution (Python):
N = int(input())
ok = False
for i in range(0, N+1, 7):
  if (N-i)%4 == 0:
    ok = True
    break
if ok:
  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):
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

N, = map(int, input().split())

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

print("No")

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

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

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

Solution (Python):
import sys


n = int(input())

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

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

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

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

Solution (Python):
N = 0
def f(x,y,total):
    total = x*4 + y*7

    if total == N:
        print("Yes")
        exit()
    elif total < N:
        f(x+1,y,total)
        f(x,y+1,total)

N = int(input())
f(0,0,0)
print("No")

Solution (Python):
n = int(input())
cake = 4
donut = 7
flag = 0
for c in range(n // cake + 1):
         for d in range(n // donut + 1):
                  if 4 * c + 7 * d == n:
                           flag = 1
if flag == 1:
         print("Yes")
else:
         print("No")

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

def main():
    N = int(input())
    for i in range(0,101,4):
        for j in range(0,101,7):
            if i+j == N:
                print("Yes")
                return
    print("No")

if __name__ == '__main__':
    main()

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

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

Solution (Python):
n = int(input())
for i in range(15):
    if (n-i*7)%4==0 and (n-i*7)>=0:
        print("Yes")
        break
else:
    print("No")

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

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

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

Flag = False
total = N
for i in range(N):
    total = N
    if total != 0:
        total -= 4 * i
    else:
        Flag = True
        break
    for j in range(N):
        if total != 0:
            total -= 7 * j
        else:
            Flag = True
            break

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 4*i + j*7 == n:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Solution (Python):
n=int(input())
for _ in range(100):
    if n<=3:
        print('No')
        break
    else:
        if n%7==0 or n%4==0:
            print('Yes')
            break
        else:
            n-=4

Solution (Python):
def main():
    N = int(input())
    n4 = [4+4*i for i in range(N//4)]
    n7 = [7+7*i for i in range(N//7)]
    ok = False
    for t in n4:
        if (N - t) % 7 == 0:
            ok = True
            break
    if not ok:
        for t in n7:
            if (N- t) % 4 == 0:
                ok = True
                break
    
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

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

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

Solution (Python):
n = int(input())
n4 = int(n / 4) + 1
n7 = int(n / 7) + 1
hit = False
for f in range(n4):
    for s in range(n7):
        if (n - f * 4 - s * 7 == 0):
            hit = True
if (hit):
    print ("Yes")
else:
    print ("No")

Solution (Python):
line = raw_input()
n = int(line)

while n > 0:
    if n % 4 == 0:
        n = 0
        break
    n -= 7
print 'Yes' if n == 0 else 'No'

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

Solution (Python):
import os, sys, re, math

lines = sys.stdin.readlines()

N = int(lines[0])

possible = False
possible |= (N % 4 == 0)
possible |= (N % 7 == 0)
if not possible:
    for i in range(1, 101):
        r = (N - 4 * i)
        possible |= (r >= 0 and r % 7 == 0)
        if possible:
            break

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

Solution (Python):
import os, sys, re, math

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

N = int(input())
print(doit(N))

Solution (Python):
a = int(input())
flag = False
for nana in range(15):
    for yon in range(26):
        if 7 * nana + 4 * yon == a:
            flag = True
print('Yes' if flag else 'No')

Solution (Python):
a = int(input())
flag = True
while a > 7 and flag:
    if a % 4 == 0:
        print('Yes')
        flag = False
    a -= 7
if flag:
    print('Yes' if a == 4 or a == 7 else 'No')

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

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

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

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

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

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

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

Solution (Python):

n = int(input())
 
count = 0

for x in range(0,n):
    for y in range(0,n):
        if x*4 + y*7 == n:
            count += 1

print("No") if count == 0 else print("Yes")

Solution (Python):
N = int(input())
flag = False
for i in range(0,N//4+2):
    for j in range(0,N//7+2):
        s = 4*i + 7*j
        if s > N: break
        if s == N:
            flag = True
            break
    if flag: break
if flag: print('Yes')
else: print('No')

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

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

count = 0

for x in range(0,N):
    for y in range(0,N):
        if x*4 + y*7 == N:
            count += 1
            
           
            

print("No") if count == 0 else print("Yes")

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

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

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())
cake,donut=0,0
x=False
for c in range(25):
  for d in range(14):
    if 4*c+d*7==N:
      x=True
print("Yes" if x==True else "No")

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

Solution (Python):


def check(dollars):
    for cakes in range(0, int(dollars / 4) + 1):
        for doughnuts in range(0, int(dollars / 7) + 1):
            sum = 4 * cakes + 7 * doughnuts
            
            if sum == dollars:
                return "Yes"
    return "No"

dollars = int(input())
print(check(dollars))

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

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

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

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

import math

for i in range(7 * n, 8 * n + 1):
  if i % 28 == 0:
    print('Yes')
    break
else:
  print('No')

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

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

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

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

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

Solution (Python):
N = int(input())
fours = int(N/4+1)
sevens = int(N/7+1)
candidates = []
for i in range(fours):
  for j in range(sevens):
    candidates.append(4*i+7*j)

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

Solution (Python):
N=int(input())
l=[4*x+7*y for x in range(26) for y in range(16)]
if N in l:
  print('Yes')
else:
  print('No')

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

Solution (Python):
n = int(input())
i = n//4
j = 0
while i >= 0 :
    m = 4*i+7*j
    if m < n : j+=1
    elif m == n : print("Yes") ; break
    else : i-=1
else : print("No")

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

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

flg = False

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

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

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

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

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

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""


    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    N = int(sys.stdin.readline())
    for i in range(100):
        for j in range(100):
            if (i * 4 + j * 7) == N:
                print("Yes")
                exit()
    else:
        print("No")

Solution (Python):
a = int(input())
sm = [ 4*i + 7*j for j in range(14) for i in range(26)].count(a)
print('Yes' if sm > 0 else 'No')

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

ans = 'No'

a = 0
b = 0

for a in range(int(n/4)+1):
	for b in range(int(n/7)+1):
		if 4*a + 7*b == n:
			ans = 'Yes'
			break

print(ans)

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

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

Solution (Python):
l=[]
for i in range(100//4+1):
    for j in range(100//7+1):
        l.append(4*i+7*j)
n=int(input())
print('Yes' if n in l else 'No')

Solution (Python):
n = int(input())
print('Yes' if len([1 for i in range(26) if (n-4*i)%7==0 and n-4*i>=0])>0 else 'No')

Solution (Python):
N = int(input())
 
num_set = []
seven_count = 0
 
while seven_count * 7 <= N:
    total = 7 * seven_count
    while total <= N:
        num_set.append(total)
        total += 4
    seven_count += 1
 
num_set = set(num_set)
 
if N in num_set:
    print('Yes')
else:
    print('No')

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

Solution (Python):


def main():

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


if __name__== "__main__":
    main()

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

for four_multiplier in range(0, n // 4 + 1):
    for seven_multiplier in range(0, n // 7 + 1):
        num = 0
        if four_multiplier == 0:
            num = 7 * seven_multiplier
        elif seven_multiplier == 0:
            num = 4 * four_multiplier
        else:
            num = 4 * four_multiplier + 7 * seven_multiplier
        if num == n:
            print("Yes")
            exit(0)
print("No")

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

num_set = []
seven_count = 0

while seven_count * 7 <= N:
    total = 7 * seven_count
    while total <= N:
        num_set.append(total)
        total += 4
    seven_count += 1

num_set = set(num_set)

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

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

num_set = []
seven_count = 0

while seven_count * 7 < 100:
    total = 7 * seven_count
    while total <= 100:
        num_set.append(total)
        total += 4
    seven_count += 1

num_set = set(num_set)

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

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

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

def do():
    for i in range(0, N + 1, 4):
        for j in range(0, N + 1, 7):
            if i + j == N:
                print("Yes")
                return
    print("No")

do()

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

for i in range(26):
    for j in range(16):
        if N == (4 * i + 7 * j):
            print('Yes')
            flag = True
            break
    if flag == True:
        break
if flag != True:
    print('No')

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

Solution (Python):
import sys
from collections import deque
import copy

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    if _solve(N):
        return 'Yes'
    return 'No'


def _solve(n):
    if n == 0:
        return True
    elif n < 0:
        return False
    else:
        ret = []
        ret.append(_solve(n - 7))
        ret.append(_solve(n - 4))
        return any(ret)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Solution (Python):
n = int(input())
flag = False
for cake in range(0,n+1,4):
    for donut in range(0,n+1,7):
        if cake + donut == n:
            print("Yes")
            flag = True
            break
    if flag:
        break
else:
    print("No")

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

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

Solution (Python):
N = int(input())
f = False
for x in range(0, 100//4):
    for y in range(0, 100//7):
        if (N == 4*x + 7*y):
            f = True
if f:
    print("Yes")
else:
    print("No")

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

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

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

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

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

print('No')

Solution (Python):
def solve():
    n = int(input())
    max_cake = n // 4
    max_donut = n // 7
    for c in range(max_cake + 1):
        for d in range(max_donut + 1):
            if n == 4 * c + 7 * d:
                return "Yes"
    return "No"


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

Solution (Python):

n = int(input())
for cake in range(25+1):
    for doughnut in range(7+1):
        total = cake * 4 + doughnut * 7
        if total == n:
            print('Yes')
            exit()

print('No')

Solution (Python):
n=int(input())
max7=n//7

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

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

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

print('No')

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

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

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

    print('No')
main()

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

Solution (Python):
N = int(input())
cake = 4
donut = 7
ac = False
for i in range(25):
    for j in range(14):
        if N == (cake * i + donut * j):
            ac = True
            break
if ac:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
print("Yes" if [4*x+7*y for y in range(25) for x in range(15)].count(int(input())) else "No")

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

Solution (Python):
n=int(input())
ans='No'
while 0<n:
  if n%7==0 or n%4==0 or n%11==0:
    ans='Yes'
    break
  n-=4
print(ans)

Solution (Python):
n=int(input())
ans='No'
if n<4:
  ans='No'
elif n%4==0 or n%7==0 or n%11==0:
  ans='Yes'
else:
  while 0<n:
    if n%7==0:
      ans='Yes'
      break
    n-=4
print(ans)

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

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

Solution (Python):
import sys
cakes = 4
donuts = 7
amount = int(input())

if amount < 4 :
    print('No')
    sys.exit()

for i in range( int( amount / 4 ) +1 ):
    if amount == i * cakes:
        print('Yes')
        sys.exit()

    for x in range( int( amount / 7 ) +1 ):
        if amount - (i * cakes ) == x * donuts:
            print('Yes')
            sys.exit()

print('No')

Solution (Python):


n=int(input())
while True:
    if n<0:
        print("No")
        break
    elif n%4==0:
        print("Yes")
        break
    else:
        n-=7

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

ans = "No"

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

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

cnum = 25
dnum = 14

res = 0

for i in range(cnum):
    for j in range(dnum):
        amm = 4 * i + 7 * j
        if amm == N:
            res += 1

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

Solution (Python):
N = int(input())
L = [4*x + 7*y for x in range(N) for y in range(N-x)]
print ("Yes" if N in L else "No")

Solution (Python):
import math
import copy
import sys

inputa = input().split()



a = int(inputa[0])























kaimen = int(a/7)+1

flg = False
for i in range(kaimen):
    if int(a - 7*i) % 4 == 0:
        flg = True
        break

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

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