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):
import sys

n = int(input())

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

Solution (Python):
from sys import stdin
N=int(stdin.readline().rstrip())
flag=0
for i in range(30):
    for j in range(20):
        if i*4 + j*7 == N:
            flag=1
if flag == 1:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):


n = int(input())

ans = False

for i in range(25):
    for j in range(25):
        money = 4 * j + 7 * i
        if n == money:
            ans = True
            break

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

Solution (Python):
N = int(input())
def four(n):
    if n % 4 is 0:
        return 0
    else:
        return n

def seven(n):
    if n % 7 is 0:
        return 0
    else:
        return n

def judge(n):
    if four(n) is 0:
        return 0
    elif seven(n) is 0:
        return 0
    elif n < 4:
        return 1
    else:
        n -= 4
        return judge(n)

if judge(N) is 0:
    print("Yes")
else:
    print("No")

Solution (Python):

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

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

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


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

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

ans = False
for i in range(N // 4 + 1):
    for j in range(N // 7 + 1):
        x = 4 * i + 7 * j
        if x == N:
            ans = True

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

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

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

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

Solution (Python):
N = int(input())
a = N//4 +1
b = N//7 +1
     
judge = False
for i in range(a):
  for j in range(b):
    if 4*i+7*j == N:
      judge =True
      break
    if 4*i+7*j > N:
      break
  if judge:
    break
     
if judge:
  print('Yes')
else:
  print('No')

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

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

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

ans = "No"

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

print(ans)

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

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

ans = False
for i in range(100//7 + 2):
  for j in range(100//4 + 2):
    if i*7 + j*4 == n:
      ans = True
      break

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

Solution (Python):

n = int(input())
list = [1,2,3,5,6,9,10,13,17]
if list.count(n)==1:
    print("No")
else:
    print("Yes")

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

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

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

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

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

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

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())
a,b=25,14
a=False

for i in range(25):
    for j in range(14):
        if 4*i+7*j==n:
            a=True
            break
    if a:
        break
if a:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
import sys
from sys import stdin
n = int(stdin.readline().rstrip())
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())
b = []
for i in range(100//4 + 1):
    a = 4*i
    while (a <= 100):
        b.append(a)
        a += 7
b = list(set(sorted(b)))
if n in b:
    print("Yes")
else:
    print("No")

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

main()

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

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

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

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

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

for i in range(int(100/7)+1):
    if 7*i > N:
        break
    for j in range(26):
        if 7*i+4*j > N:
            break
        elif 7*i+4*j == N:
            judge = True
            break
    
if judge:
    print("Yes")
else:
    print("No")

Solution (Python):
def inp_i(): return map(int, input().split())

N=int(input())
ans=0
for i in range(N):
    for n in range(N):
        if (4*i)+(7*n)==N:
            ans += 1
if ans != 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N=int(input())
flag=True
for i in range(26):
    if flag:
        for j in range(16):
            if 4*i+7*j==N:
                print('Yes')
                flag=False
                break
if flag:
    print('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()
print("No")

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

dp = [False for i in range(N + 1)]
prices = [4, 7]
dp[0] = True

for p in prices:
    for j in range(N + 1):
        if not dp[j]:
            continue
        idx = j + p
        if idx > N:
            break
        dp[idx] = True
if dp[N]:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):

N = int(input())


exist = False           
for i in range(100):    
  for j in range(100):  
    s = i*4 + j*7       
    if s == N:          
      exist = True      


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

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

Solution (Python):
import sys  


N = int(input())


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

Solution (Python):
N=int(input())
true=False
can=False
for num7 in range(100):
    if can:
        break
    for num4 in range(100):
        sum=num7*7+num4*4
        if sum>N:
            break
        if sum==N:
            true=True
            can=True
            break
if true:
    print("Yes")
else:
    print("No")

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

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

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

for i in range(26):
    for j in range(16):
        sum_num = 4*i + 7*j
        if 100 < sum_num:
            break

        if sum_num == n:
            print("Yes")
            exit()
print("No")

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

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())
judge = 0

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

Solution (Python):
N = int(input())
n = N % 28
incorrects = [1,2,3,5,6,9,10,13,17]
answer = True
for incorrect in incorrects:
    if n == incorrect:
        answer = False
        break
if answer:
    print('Yes')
else:
    print('No')

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

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())
if N%7 == 0:
	print('Yes')

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

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

flag = False
for ai in range(100):
	for bi in range(100):
		if ai*4+bi*7 == n:
			flag = True
			break

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

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

aNum = 100//4
bNum = 100//7

flag = False
for ai in range(aNum):
	for bi in range(bNum):
		if ai*4+bi*7 == n:
			flag = True

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

Solution (Python):
n=int(input())
a=[]
for x in range(15):
    for y in range(26):
        a.append(x*7+y*4)
if not n in a:
    print("No")
else:
    print("Yes")

Solution (Python):
import sys

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

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'
      break
print(ans)

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

ans = False

for i in range((n // 4) + 1):
    for j in range((n // 7) + 1):
        if 4 * i + 7 * j == n:
            ans = True

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

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

c = 0

for i in range(25):
	for j in range(15):
		if i*4+j*7 == n:
			c += 1
	
		if i*4+j*7 >100:
			break
  
if c != 0:
	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())

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

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

able = False
for i in range(int(N / 4) + 1):
    for j in range(int(N / 7) + 1):
        if 4 * i + 7 * j == N:
            able = True
print('Yes' if able else 'No')

Solution (Python):
def cakes_and_donuts(N: int) -> bool:
    while N > 0:
        if N % 4 == 0:
            return True
        N -= 7

    return N == 0  


if __name__ == "__main__":
    N = int(input())
    yes = cakes_and_donuts(N)
    print('Yes' if yes else 'No')

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

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

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

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

Solution (Python):
def rec(x):
  if x < 4:
    return False
  if x % 4 == 0 or x % 7 == 0:
    return True
  return rec(x - 4) or rec(x - 7)
 
if rec(int(input())):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys

N = int(input())

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

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

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

Solution (Python):
n = int(input())
r=[4, 7, 8, 11, 12, 14, 15, 16]
if n>17 or n in r:
    print('Yes')
else:
    print('No')

Solution (Python):
def solve(string):
    n = int(string)
    return "Yes" if any([(n - 7 * i) % 4 == 0 for i in range(n // 7 + 1)]) else "No"


if __name__ == '__main__':
    print(solve(input()))

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

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())

n7 = N//7+1

ans = "No"
for i in reversed(range(n7+1)):
    if 7*i > N:
        continue
    elif 7*i == N:
        ans = "Yes"
        break
    else:
        r = N-7*i
        if r % 4 == 0:
            ans = "Yes"
            break
print(ans)

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

totals = [4 * x + 7 * y for x in range(N // 4 + 1) for y in range(N // 7 + 1)]
print('Yes' if N in totals else 'No')

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

if N % 7 ==0:
    answer = 'Yes'

while N > 0:
    if N % 4 == 0:
        answer = 'Yes'
    N -= 7

else:
    print(answer)

Solution (Python):
def solve():
    N = int(input())
    for i in range(16):
        if N - 7 * i < 0:
            continue
        if (N - 7 * i) % 4 == 0:
            return 'Yes'
    return 'No'

ans = solve()
print(ans)

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

def func(n):
    for k in range(N//4 + 1):
        for d in range(N//7 + 1):
            if 4 * k + 7 * d == N:
                return 'Yes'
    return 'No'

print(func(N))

Solution (Python):

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

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

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

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

for x in range(100//4+1):
  for y in range(100//7+1):
    if 4*x+7*y==N:
      flag=True
      break

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

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

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

Solution (Python):
n=int(input())
l=[]
for i in range(26):
    for k in range(16):
        l.append(4*i+7*k)
print("YNeos"[n not in l::2])

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


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
judge = 0
for i in range(n // 7 + 1):
    if (n - 7 * i) % 4 == 0:
        judge = 1

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

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

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

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

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

Solution (Python):

import math
import sys


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

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

if solve(N):
  print("Yes")
else:
  print("No")

Solution (Python):

"""
Created on Wed Feb 27 16:39:16 2019

@author: yuta
"""

def cakedonut(n):
    count = 0
    if n != 0:
        max_count = (int(n/7) + 1) * (int(n/4) + 1)
        for i in range(int(n/7) + 1):
            for j in range(int(n/4) + 1):
                price = 7 * i + 4 * j
                rest = n - price
                if rest == 0:
                    break
                else:
                    count += 1
        if count < max_count:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
        
N = int(input())
cakedonut(N)

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

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

for i in range(int(N/4)+1):
    for j in range(int(N/7)+1):
        if 4*i+7*j == N:
            D = True
            break
        elif j == int(N/7)+1:
            D = False

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

Solution (Python):
N = int(input())
max_c = N//4 
max_d = N//7
flag = 0
for i in range(max_c + 1):
	for j in range(max_d + 1):
		cost = 4*i + 7*j
		if cost == N:
			flag = 1

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

Solution (Python):
def det(n):
    seven = range((n // 7) + 1)
    four = range((n // 4) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == n:
                return 'Yes'
    return 'No'
x = int(input())
print(det(x))

Solution (Python):
n=int(input())
for s in range(0,26):
  try:
    for t in range(0,16):
      if 4*s+7*t==n:
        print("Yes")
        exit()
  except ZeroDivisionError:
    continue
print("No")

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


if __name__ == "__main__":
    main()

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

Solution (Python):
def cakes_and_donuts(arg1):
    four = range(( arg1 // 4 ) + 1)
    seven = range(( arg1 // 7 ) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == arg1:
                return 'Yes'
    return 'No'

N = int(input())
print(cakes_and_donuts(N))

Solution (Python):
n=int(input());print('YNeos'[n<-n%4*7::2])

Solution (Python):
N = int(input())
answer = "No"
cake = N//4
nut = N//7

for x in range(cake+1):
  for y in range(nut+1):
    if 4*x + 7*y == N:
      answer = "Yes"

print(answer)

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

cake = N//4
nut = N//7

answer = 'No'

for i in range(cake+1):
	for j in range(nut+1):
		if i*4 + j*7 == N:
			answer = 'Yes'

print(answer)

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

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

  for i in range(26):
    if i * 4 > N:
      break
    if (N - i * 4) % 7 == 0:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

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

Solution (Python):


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


if __name__ == '__main__':
    main()

Solution (Python):

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

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

Solution (Python):
n = int(input())
flag = 'No'
for f in range(25):
  for s in range(15):
    if n == f * 4 + s * 7 or n % 4 == 0 or n % 7 == 0:
      flag = 'Yes'
      break
print(flag)

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

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

if N%4==0:
  print('Yes')
elif N%4==1:
  if N>=21:
    print('Yes')
  else:
    print('No')
elif N%4==2:
  if N>=14:
    print('Yes')
  else:
    print('No')
elif N%4==3:
  if N>=7:
    print('Yes')
  else:
    print('No')

Solution (Python):
def main() -> None:
    N = int(input())
    for x in range(0, N+1, 4):
        for y in range(0, N+1, 7):
            if x + y == N:
                print("Yes")
                exit()
    print("No")


if __name__ == '__main__':
    main()

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

torf = False

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

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

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

if n >= 18:
    print("Yes")
elif 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):
int_n = int(input())

if int_n in [4 * k + 7 * d for k in range(101) for d in range(101)]:
    print("Yes")
else:
    print("No")

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

if n<=3 or n==5 or n==6 or n==9 or n==10 or n==13 or n==17:
  print('No')
else:
  print('Yes')

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

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  
  ans = 'No'
  if N % 7 == 0:
    ans = 'Yes'
  else:
    for i in range(N//7+ 1):
      m = N - 7 * i
      if m % 4 == 0:
        ans = 'Yes'
        break
  
  print(ans)


if __name__ == '__main__':
  main()

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

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

flg = False

for i in range(101):
    for j in range(101):
        if 100 < i + j:
            break
        if 4 * i + 7 * j == N:
            flg = True
            continue
    if flg:
        break

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

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

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

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

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

Solution (Python):

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

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

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

Solution (Python):
n=int(input())
if n<4:
    print("No")
elif n%4==0 or n%7==0:
    print("Yes")
else:
    result=False
    num=n
    while num>7:
        num-=7
        if num%4==0 and result==False:
            print("Yes")
            result=True
            break
    while n>4:
        n-=4
        if n%7==0 and result==False:
            print("Yes")
            result=True
            break
    if result==False:
        print("No")

Solution (Python):
n = int(input())
max_cake = n//4
max_donut = n//7
ans = "No"
if max_cake != 0 or max_donut != 0:
    for cake in range(0, max_cake+1):
        for donut in range(0, max_donut+1):
            if (cake != 0 or donut != 0):
                if n % (4*cake + 7*donut) == 0:
                   ans = "Yes"
print(ans)

Solution (Python):
d=int(input())
no=0
n=int(1+d/7)

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

Solution (Python):
N = int(input())
x = 0
result = False
while x < 100:
    d = 0
    sum = 0
    while sum <= N:
        sum = 4*x + 7*d
        if sum == N:
            result = True
            break
        d += 1
    if result == True:
        break
    x += 1

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

Solution (Python):
def 解():
    N = int(input())
    def testD(N,iD1,iD2):
        while 0 < N:
            if N % iD1 == 0:
                return True
            else:
                N -= iD2
        return False
    if testD(N,4,7) or testD(N,7,4):
        print("Yes")
    else:
        print("No")
解()

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

Solution (Python):
def fits(N):
    answer = 'No'
    for cake in range(0,100,4):
        for donut in range(0,100,7):
            if cake + donut is N:
                answer = 'Yes'
    return answer
if __name__ == '__main__':
    N = int(input())
    print(fits(N))

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):
import sys
n = int(input())
a = n // 7

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

Solution (Python):
class Solver(object):
    def __init__(self):
        self.valids = self._generate_valid_list()
        self.n = int(input())

    def solve(self):
        if self.n in self.valids:
            print("Yes")
        else:
            print("No")

    def _generate_valid_list(self):
        valids = set()
        for cake in range(26): 
            for donut in range(16):  
                valids.add( (donut*7) + (cake*4) )
        return valids


if __name__ == "__main__":
    s = Solver()
    s.solve()

Solution (Python):
n=int(input())
n4=n
n7=n
ans=0

while(1):
    if n4%4==0 or n7%7==0:
        ans=1
        break
    else:
        if n4>7:
            n4-=7
        if n7>4:
            n7-=4
    if n4<=7 and n7<=4:
        break

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

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

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

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

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

Solution (Python):
N = int(input())
flg = False
for i in range(26):
    if (N - 4*i) % 7 == 0 and (N - 4*i) >= 0:
        flg = True
print('Yes') if flg else print('No')

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

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

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

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

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