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:
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")
                quit()
            else:
                pass
print("No")

Submission status: Accepted

Solution code:
N=int(input())
flag=0
for i in range(26):
  for j in range(15):
    if i*4 + j*7 == N:
      flag=1
      break
  if flag==1:
    break
if flag==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
nnn = n%28
ans = ('No')
for i in range(5):
    for h in range(8):
        if nnn == i*7+h*4:
            ans = ('Yes')
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"
for m in range(100):
    for n in range(100):
        if 4 * m + 7 * n == N:
            ans = "Yes"

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
check = False
for i in range(n//7+1):
  if (n - 7 * i) % 4 is 0:
    check = True
    break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n=int(input())
ans=False
if n%7==0 or n%4==0:
        ans=True
        print('Yes' if ans else 'No')
        sys.exit()

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

Submission status: Accepted

Solution code:
N = int(input())

exists = False

for i in range(30):
    for j in range(20):
        if 4 * i + 7 * j == N:
            exists = True
            break

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

Submission status: Accepted

Solution code:
n=int(input())
print('Yes'if [4*a+7*b for a in range(n) for b in range(n)].count(n)!=0 else 'No')

Submission status: Accepted

Solution code:
a=[]
for i in range(0,26):
  for ii in range(0,14):
    c=i*4+ii*7
    if c<101:
      a.append(c)
if int(input()) in a:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

for cake in range(26):
    for donut in range(15):
        if cake*4 + donut*7 == N:
            flag = 1
            break
    if flag == 1:
        break

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

  for x in range(N // 4 + 1):
    for y in range((N - x * 4) // 7 + 1):
      if x * 4 + y * 7 == N:
        print('Yes')
        return
  print('No')


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
import itertools

N = int(input())

ans = 'No'
for a, b in itertools.product(range(26), range(15)):
    if 4 * a + 7 * b == N:
        ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
def check(fours,sevens,rem):
    if rem<0:
        return False
    elif rem==0:
        return True
    elif rem > 0:
        bf,bs = False,False
        bf = check(fours+1,sevens,rem-4)
        bs = check(fours,sevens+1,rem-7)
        if bf or bs:
            return True
        else:
            return False
        
if check(0,0,n) == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input().strip())
cost = N
if cost % 7 == 0:
  print('Yes')
  exit()
for _ in range(N):
  if cost < 4:
    print('No')
    break
  elif cost % 4 == 0:
    print('Yes')
    break
  cost -= 7

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
C = int(N / 4)
D = int(N / 7)
ans = "No"
for c in range(0, C+1):
    for d in range(0, D+1):
        if c*4 + d*7 == N:
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
for cake in range(100):
  for donut in range(100):
    if cake * 4 + donut * 7 == n:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
for cake in range(n):
  for donut in range(n):
    if cake * 4 + donut * 7 == n:
      print("Yes")
      break
  else:
    continue
  break
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
Key=False
for i in range(50):
    for j in range(15):
        if j*7+i*4==N:
            Key=True
            break
        
if Key==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

def main():
    flg = 0
    num = int(input())
    for i in range(100):
        if i * 4 > num:
            break
        for j in range(100):
            if i * 4 + j * 7 == num:
                flg = 1
                break
            elif i * 4 + j * 7 > num:
                break
    if flg:
        print('Yes')
    else:
        print('No')




if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
max_cakes = math.ceil(n/4)
max_donuts = math.ceil(n/7)
flag = 0
for i in range(max_cakes+1):
    for j in range(max_donuts+1):
        if 4*i+7*j == n:
            flag = 1
if flag:print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
n = int(input())
for cake in range(n):
    for donut in range(n):
        if cake * 4 + donut * 7 == n:
            print("Yes")
            break
    else:
        continue
    break
else:
    print("No")

Submission status: Accepted

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

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

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())
l = []

for i in range(26):
    p = i*4
    for j in range(15):
        l.append(p+j*7)
        
if n in l:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import itertools

N = int(input())

if N%4 ==0 or N%7 ==0:
  print('Yes')
  exit()
else:
  i = itertools.product(range(N//4+1),range(N//7+1))
  

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

print('No')

Submission status: Accepted

Solution code:
a=[0,4,7,8,11,12,15,16,18,19,20,22,23,24,25,26,27]
b=int(input())
b%=28
print(["No","Yes"][b in a])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int):
    for i in range(0, N+1):
        if (i % 4 == 0) and ((N - i) % 7 ==0):
            return YES
    return NO


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

n = int(input())

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

print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# user: herp_sy

def quicksort(seq):
  if len(seq) < 1:
      return seq
  pivot = seq[0]
  left = []
  right = []
  for x in range(1, len(seq)):
    if seq[x] <= pivot:
        left.append(seq[x])
    else:
        right.append(seq[x])
  left = quicksort(left)
  right = quicksort(right)
  foo = [pivot]
  return (left + foo + right)

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

n = int(input())
while n >= 4:
  if n % 4 == 0 or n % 7 == 0:
    print('Yes')
    exit(0)
  elif n > 4:
    n = n - 4
  elif n > 7:
    n = n - 7
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:
price = []
N = int(input())
for i in range(N//4 + 1) :
    for j in range(N//7 + 1) :
        price.append(i*4+j*7)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())

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

print('No')

Submission status: Accepted

Solution code:
N = int(input())
i = 0
j = 0
cnt = 0
while True :
    K = i * 4 + j * 7
    if K == N :
        print('Yes')
        break
    elif N < K and cnt == 0 :
        print('No')
        break
    elif N < K :
        j += 1
        i = 0
        cnt = 0
    else :
        i += 1
        cnt += 1

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N // 4 + 1):
  for j in range((N - i * 4) // 7 + 1):
    if 4 * i + 7 * j == N:
      print('Yes')
      exit()
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):
        sum=4*i+7*j
        if sum==n:
            flag=True
print('Yes' if flag else'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())
ans = 0
buy = N//4 + 1
for i in range(buy):
  for j in range(buy):
    if 4*i+7*j == N:
      ans += 1
print("Yes" if ans!=0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input());p=n//7;print('YNeos'[not any([(n-k*7)%4==0for k in range(p+1)])::2])

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
N=int(input())
memo=[]
for i in range(26):
    for j in range(15):
        memo.append(i*4+j*7)
if N in memo:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
if n%7 == 0 or n%4 == 0:
    print("Yes")
    exit()

for i in range(4,101,4):
    for j in range(7,101,7):
        if i+j > 100: break
        if i+j == n:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

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

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

print('No')

Submission status: Accepted

Solution code:
N = int(input())

c=N//4 +1
d=N//7 +1

ans = 'No'

for i in range(0,c):
    for j in range(0,d):
        if 4*i + 7*j ==N:
            ans='Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:UTF-8
# 4$ cake
# 7$ donuts
n = int(input())
count = 0
for i in range(25+1):
  for j in range(17+1):
    if 4*i+7*j == n:
      count = count+1
if count > 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# ABC105B - Cakes and Donuts
n = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC105B
N = int(input())
OK = False
for i in range(26):
    for j in range(26):
        if i*4 + j*7 == N:
            OK = True
            break
if OK:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#ABC105B
N = int(input())
flag = False
for i in range(30):
    for j in range(30):
        if i*4 + j*7 == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=[]
for i in range(100//4+1):
    for j in range(100//7+1):
        a.append(i*4+j*7)
a=list(set(a))
b=[]
for i in range(1,101):
    if not(i in a):b.append(i)
print("No" if int(input()) in b else "Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

def is_buyable():
  output = 0
  for a in range(int(100/4)+1):
    for b in range(int(100/7)+1):
      total = 4*a + 7*b
      if total == N:
        return True

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

Submission status: Accepted

Solution code:
def yn(n):
  for i in range(26):
    for j in range(15):
      if 4*i+7*j==n:
        return True
  return False
      
n=int(input())
if yn(n):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
f = False
for i in range(15):
  if (N - 7 * i) // 4 >= 0 and (N - 7 * i) % 4 == 0:
    f = True
    break
if f:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math
import itertools

if __name__ == '__main__':
    n = int(input())

    ra = range(math.floor(n / 4) + 1)
    rb = range(math.floor(n / 7) + 1)
    prod = list(itertools.product(ra, rb))

    for a, b in prod:
        if 4 * a + 7 * b == n:
            print('Yes')
            exit(0)

    print('No')

Submission status: Accepted

Solution code:
import math

n = int(input())

#ケーキ0個からN/4個まで
for c in range(0,math.floor(n/4)+1,1):
  #ドーナツ0～N/7個まで
  for d in range(0,math.floor(n/7)+1,1):
    if c*4 + d*7 == n:
      print('Yes')
      exit()
      
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
# 4 * 25 = 105, 7 * 15 = 105
values = [i*4 + j*7 for i in range(25) for j in range(16)]
print('Yes' if n in values else 'No')

Submission status: Accepted

Solution code:
N=int(input())
for i in range(26):
    if (N-i*4)%7==0 and N-i*4>=0:
        print("Yes")
        exit()
            
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())

max_cake = N // 4
max_donut = N // 7

ans = 'No'
is_detected = False
for i in range(max_cake + 1):
  for j in range(max_donut + 1):
    if 4 * i + 7 * j == N:
      ans = 'Yes'
      is_detected = True
      break
  if is_detected:
    break

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
Y = 'Yes'
N = 'No'
count = 0

for i in range(26):
  for j in range(15):
    if 4 * i + 7 * j == n:
      count +=1
print(Y if count > 0 else N)

Submission status: Accepted

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

n = int(input())
count = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for a in range(n+1):
    for b in range(n+1):
        ans = 4*a + 7*b
        if ans == n:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

print("No")

Submission status: Accepted

Solution code:
N=int(input())
ans=0
if N>3:
    for i in range(N):
        for j in range(N):
            if 4*i+7*j==N:
                ans=ans+1
final_answer=lambda x:'Yes' if ans!=0 else 'No'
print(final_answer(ans))

Submission status: Accepted

Solution code:
N = int(input())
cake = 4
dounute = 7
if N < cake and N < dounute:
    print("No")
    exit() 
for i in range(N):
    for j in range(N):
        if (dounute * i + cake * j) == N:
            print("Yes")
            exit()
        elif (dounute * j + cake * i) == N:
            print("Yes")
            exit()
        else:
            continue
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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 4 * i + 7 * j == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
	N = int(input())
	dp = [False]*(101)
	dp[0] = True
	dp[4] = True
	dp[7] = True
	for i in range(4, 101):
		if i + 7 <= 100:
			dp[i+7] = dp[i+7] or dp[i]
		if i + 4 <= 100:
			dp[i+4] = dp[i+4] or dp[i]

	if dp[N]:
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
dp=[0]*101
dp[4]=1
dp[7]=1
for i in range(101):
  if dp[i]==1 and i+4<101:
    dp[i+4]=1
  if dp[i]==1 and i+7<101:
    dp[i+7]=1

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

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

ans = "No"

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print('No')

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

l = [False for _ in range(N + 1)]
def solve():
    ans = 0
    l[0] = True
    for i in range(N + 1):
        if l[i] and i + 4 < N + 1:
            l[i + 4] = True
    for i in range(N + 1):
        if l[i] and i + 7 < N + 1:
            l[i + 7] = True
    return l[N]

if __name__ == "__main__":
    if solve():
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
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
  else:
    continue
  break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def dfs(x):
    if x > 100:
        return 0
    cnt = 1 if x == N else 0
    cnt += dfs(x+4)
    cnt += dfs(x+7)
    return cnt

print('Yes' if dfs(0) >= 1 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

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

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input())
a=math.floor(N/7)
flag=False
for i in range(a+1):
    N2=N-i*7
    if N2%4!=0:
        continue
    else:
        flag=True
        break
if flag==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
for x in range(26):
  for y in range(15):
    if (4 * x + 7 * y == N):
      print('Yes')
      exit()

print('No')

Submission status: Accepted

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

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

print('Yes' if count > 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for cake in range(26):
    flag = False
    for donut in range(15):
        if 4 * cake + 7 * donut == N:
            print('Yes')
            flag = True
            break
    if flag:
        break
    

else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

else:
    print('No')

Submission status: Accepted

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

n = int(input())
count = 0

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

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

Submission status: Accepted

Solution code:
N = int(input())

f = False
for i in range(N):
    for j in range(N):
        if i*4 + j*7 == N:
            f = True
            break
        if i*4 + j*7 > N:
            break
    if f:
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

count=0
for i in range(30):
    for j in range(20):
        total = 4*i + 7*j
        if(total==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())
cnt=0

for an in range(26):
    for bn in range(15):
        if 4*an+7*bn==N:
            cnt+=1

if cnt!=0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

for an in range(26):
    for bn in range(15):
        if 4*an+7*bn==N:
                counter+=1

if counter != 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(N: int):
    for i in range(26):
        for j in range(15):
            if i*4+j*7 == N:
                yes()
                return
    no()

    return


def main():

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
n = int(raw_input())
start = int(math.floor(-2*n/7.))
end = int(math.ceil(-n/4.)+1)
for i in range(start,end):
	a = 2 * n + 7 * i
	b = -n - 4 * i
	if (a >= 0) & (b >= 0):
		print 'Yes'
		sys.exit()
print 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
flag = False
for i in range(n + 1):
    for j in range(n + 1 - i):
        if i * 4 + j * 7 == n:
            flag = True
print("YNeos"[not flag::2])

Submission status: Accepted

Solution code:
N = int(input())
Flag = False
# ドーナツをi個
for i in range(15):
    for j in range(26):
        if 7*i+4*j == N:
            Flag = True
if Flag == True:
    print('Yes')
else:
    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())
flag = False
answer = 'No'
for i in range(-(-N//4)+1):
    for j in range(-(-N//7)+1):
        res = 4*i + 7*j
        if res == N:
            answer = 'Yes'
            flag = True
            break
    if flag:
        break
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
chk = 0
i=0
while(i<26 and chk==0):
    j=0
    while(j<15 and chk==0):
        if(n==4*i+7*j):
            chk=1
        elif(n<4*i+7*j):
            break
        j+=1
    i+=1
if(chk==1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

main()