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.



Sample input:
11


Sample output:
Yes

Submission status: Accepted

Solution code:
line = raw_input()
n = int(line)
# 4 7
while n > 0:
    if n % 4 == 0:
        n = 0
        break
    n -= 7
print 'Yes' if n == 0 else 'No'

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

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)

Submission status: Accepted

Solution code:
N=int(input())
#number of cakes
if all( (N - 4*i) % 7 != 0 for i in range(N//4 + 1)):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC105 B - Cakes and Donuts
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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
            # print("{}, {}, {}, {}".format(cakes, doughnuts, sum, sum == dollars))
            if sum == dollars:
                return "Yes"
    return "No"

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

import math

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
#7ドルのループ
for i in range(int((n+7-1)/7)+1):
    #4ドルのループ
    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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#4と7は互いに素
#7を引いてって、4の倍数になるまでやる
n=int(input())
while True:
    if n<0:
        print("No")
        break
    elif n%4==0:
        print("Yes")
        break
    else:
        n-=7

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import copy
import sys

inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

mxc=n//4
mxd=n//7
for i in range(0,mxc+1) :
  for j in range(0,mxd+1) :
    if n==(i*4+j*7) :
      print("Yes")
      exit()
      #break
      
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
fl = False
for i in range(n // 4+1):
        for j in range(n // 7+1):
            if i * 4 + j * 7 == n:
                fl = True
print("Yes") if fl else print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*-coding: utf-8 -*-
N = int(input())
ans = "No"
for i in range(N//4 + 1):
    for k in range(N//7 + 1):
        if 4*i + 7*k == N:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

hantei = 0

for j in range(0,26):
    for k in range(0,15):
        if N == 4 * j + k * 7:
            hantei = 1
            break

if hantei == 0:
    print("No")

else:
    print("Yes")

Submission status: Accepted

Solution code:
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 'No')

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for x in range(1 + n//4):
  if (n-4*x)%7 == 0:
    flag = True
    break
    
if flag:
  print("Yes")
else :
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

flag = False

for x in range(1+n//4):

    if (n-4*x)%7 == 0:
        flag = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n % 7 == 0 or (n >= 8 and n % 7 ==1) or n % 7 ==4 or (n >= 12 and n % 7 ==5):
  print('Yes')
elif n % 4 == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
 
flag = False
for i in range(n // 4 + 1):
  for j in range(n // 7 + 1):
    if i * 4 + j * 7 == n:
      flag = True

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

Submission status: Accepted

Solution code:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
flag = 0
q4 = N // 4
for i in range(q4+1):
  if(N - 4 * i) % 7 == 0:
    print('Yes')
    flag = 1
    break
if flag == 0: print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

        # if i * 4 + j * 7 > n:
        #     break
print('No')

Submission status: Accepted

Solution code:
n = int(input())

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

        if i * 4 + j * 7 > n:
            break
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())

for i in range(15):
  if (N - 7 * i) % 4 == 0 and (N - 7 * i) / 4 >= 0:
    print("Yes")
    sys.exit()
    
print("No")

Submission status: Accepted

Solution code:
n = int(input())
check = False

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

if check is False:
    print('No')

Submission status: Accepted

Solution code:
ndol = int(input())
bool_ = ndol in [4 * i + 7 * j for j in range(ndol // 7 + 1) for i in range(ndol // 4 + 1)]
print("Yes" if bool_ else "No")

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
 
donuts=N//7
ans="No"

for i in range(donuts,-1,-1):
  left_price=N-7*i
  if left_price%4==0:
    ans="Yes"
    break
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 'No'

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
M = [4*i+7*j for i in range(30) for j in range(20)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

cake_max = int(N / 4)
price_tmp = N

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

Submission status: Accepted

Solution code:
n=int(input())

l=[4*x+7*y for x in range(26) for y in range(16)].count(n)
print('Yes' if l!=0 else 'No')

Submission status: Accepted

Solution code:
def main():
    N = int(input())  # total doll 1 <= N <= 100
    for d in range(20):
        for c in range(25):
            total = d * 7 + c * 4
            if total == N:
                print('Yes')
                return

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
l = [x*4 + y*7 for x in range(100) for y in range(100)]
n = int(input())
ans = 'Yes' if n in l else 'No'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())


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

Submission status: Accepted

Solution code:
n = int(input())
answer = 'No'

for i in range(26):
    for j in range(14):
        if n == (i * 4) + (j * 7):
            answer = 'Yes'

print(answer)

Submission status: Accepted

Solution code:
r=range;l=[4*i+7*j for i in r(26)for j in r(15)]
print("NYoe s"[int(input())in l::2])

Submission status: Accepted

Solution code:
n = int(input())
c = [i for i in range(0,n+1) if i%4 == 0]
d = [j for j in range(0,n+1) if j%7 == 0]
for x in range(len(c)):
    for y in range(len(d)):
        if c[x] + d[y] == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

itr = max([n//4+1,n//7+1])
for i in range(itr):
	for j in range(n):
		summ = 4*i + 7*j
		if summ == n:
			print("Yes")
			quit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())
ans = "No"
for x in range(26):
  for y in range(14):
    if 4*x + 7*y == n:
      ans = "Yes"
      break
print(ans)

Submission status: Accepted

Solution code:
#ABC 105, B - cakes and donuts
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
 
c = 0

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

Submission status: Accepted

Solution code:
N = int(input())

c = 0
X = N//4 +1

for i in range(X):
    if N - i*4 <0:
        break
    if (N - i*4) == 0 or (N-i*4)%7 == 0:
        print("Yes")
        exit()
print("No")