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

def solve(N):
    for i in range(N // 4 + 1):
        for j in range(N // 7 + 1):
            if 4 * i + 7 * j == N:
                return True
    else:
        return False

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
for i in range(26):
    for j in range(100):
        c = 4 * i
        d = 7 * j
        if c + d > N:
            break

        if c + d == N:
            print("Yes")
            sys.exit()


print("No")

Submission status: Accepted

Solution code:
N=input()
for x in range(26):
	for y in range(16):
		if N==4*x+7*y:
			print "Yes"
			quit()
else:
	print "No"

Submission status: Accepted

Solution code:
N = int(input())

four = int(N/4)
seven = int(N/7)

flag=0

for i in range(1,four+1):
    sum = 4*i
    while(sum<=N):
        if(sum==N):
            flag=1
        sum+=7

for i in range(1,seven+1):
    sum2 = 7*i
    while(sum2<=N):
        if(sum2==N):
            flag=1
        sum2+=4
    
if(flag==1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

ans = False

for i in range(0, N+1, 7):
    tmp = N - i
    if tmp % 4 == 0:
        ans = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 17:33:57 2018
ABC105B
@author: maezawa
"""

n = int(input())

ans = 'No'

for m in range(26):
    for l in range(15):
        if 4*m + 7*l == n:
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
A = int(input());
answer_no = [1,2,3,5,6,9,10,13,17];
answer = 1

for i in answer_no:
    if(A==i):
        answer=0;

if(answer==1):
    print("Yes");
else:
    print("No");

Submission status: Accepted

Solution code:
from math import floor

def main():
    n = int(input())

    seven = floor(n/7)
    for i in range(seven+1):
        mod = n - i*7
        if mod % 4 == 0:
            print('Yes')
            return
    print('No')


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

cand = [4*i for i in range(1, 100 // 4 + 1)]+[7*i for i in range(1, 100 // 7 + 1)]
cand = cand + [c + 7*i for c in cand for i in range(1,15)]

if N in set(cand):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

#n,k=[int(i) for i in input().split()]



n=int(input())


ok=0
for i in range(100):
    if n>=4*i and (n-4*i)%7 == 0:
        ok = 1
        break

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

Submission status: Accepted

Solution code:
N = int(input())

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

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:
def calc(N):
    max_num_cake = N / 4
    max_num_donut = N / 7
    for i in range(max_num_cake + 1):
        for j in range(max_num_donut + 1):
            if 4 * i + 7 * j == N:
                return True
    return False

N = input()
if calc(N):
    print 'Yes'
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:
a = int(input())
max_i = a // 7

for i in range(max_i + 1):
    b = a - i * 7
    if b % 4 == 0:
        print("Yes")
        exit(0)

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())


check=0
for i in range(25):
    if (N-i*4)/7>=0 and (N-i*4)%7==0:
        check=1
        #print(i,(N-i*4)//7)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = []
for i in range(100):
    for j in range(100):
        if (i*4+j*7 <= 100):
            l.append(i*4+j*7)
if N in l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
i = 0
for i1 in range(26):
    for i2 in range(15):
        if 4 * i1 + 7 * i2 == N:
            i = 1
if i == 1:
    print("Yes")
elif i == 0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect

def s():
    return input()
def n():
    return int(input())
def d():
    return float(input())

def ls():
    return input().split()
def ln():
    return map(int, input().split())
def ld():
    return map(float, input().split())

def fs():
    return [input() for i in range(input())]
def fn():
    return [int(input()) for i in range(input())]
def fd():
    return [float(input()) for i in range(input())]

N = n()


li=[]
for i in range(26):
    for j in range(16):
        li.append(i*4+j*7)

if N in li:
    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:
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    i = 0
    while True:
        n = N - 4 * i
        if n < 0:
            break
        if n % 7 == 0:
            print('Yes')
            return
        i += 1
    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n = int(input())

for i in range(int(n/4) + 1):
    for j in range(int((n-4*i)/7) + 1):
        #print("4:{} 7:{} {}".format(i, j, 4*i+7*j))
        if 4*i + 7*j == n:
            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):
    if (n-4*i)%7 ==0:
        flag=True
print('Yes' if flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
d=1
for i in range(0,25):
    for j in range(0,15):
        if a==4*i+7*j:
            d=3
if d==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

while n > 0:

    if n == 7:
        flag = True
        break

    elif n % 4 == 0:
        flag = True
        break

    n = n - 7

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

Submission status: Accepted

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

    ans = f(N)
    print(ans)


def f(N):
    for f in range(25+1):
        for s in range(14+1):
            if (f * 4 + s * 7) == N:
                return "Yes"

    return "No"


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools

def f(n):
    cnt = n // 4 + 1
    return 'Yes' if any(a * 4 + b * 7 == n for a, b in itertools.product(range(cnt), repeat=2)) else 'No'

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

Submission status: Accepted

Solution code:
N = int(input())

init7 = N // 7
fl = True

for i in range(init7 + 1):
  if (N - 7 * i) % 4 == 0:
    print("Yes")
    fl = False
    break

if(fl):
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8
#


def main(input_str):
    n = int(input_str)
    for i in range(0, 100):
        h = 7*i
        if n < h:
            break

        if 0 == (n - h) % 4:
            print('Yes')
            return
    print('No')
        
if __name__ == '__main__':
    try:
        main(input().strip())
    except EOFError:
        pass

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N % 4 == 0 or N % 7 == 0:
    print("Yes")
else:
    d = N // 7
    while d > 0 and (N - d * 7) % 4 != 0:
        d -= 1
    if d == 0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
 
k = N//4
m = N%4
if(m == 0):
  print("Yes")
elif(m == 1):
  if(k>=5):
    print("Yes")
  else:
    print("No")
elif(m==2):
  if(k>=3):
    print("Yes")
  else:
    print("No")
elif(m==3):
  if(k>=1):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

max_coef_4 = N // 4
max_coef_7 = N // 7

possible_price = set()

for coef_4 in range(max_coef_4 + 1):
    for coef_7 in range(max_coef_7 + 1):
        possible_price.add(4 * coef_4 + 7 * coef_7)

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

Submission status: Accepted

Solution code:
N = int(input())

for k in range(16):
    for l in range(26):
        if k*7+l*4 == N:
            print("Yes")
            exit(0)
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()

print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

print('No')

Submission status: Accepted

Solution code:
N = int(input())

able = False


for i in range(26):
    for j in range(16):
        numbers = 4*i + 7*j
        if numbers == N:
            able = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = set()

for i in range(26):
    for j in range(15):
        s.add(4*i+7*j)

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

Submission status: Accepted

Solution code:
n = int(input())
a = [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
if a[n] == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())

r = N // 7

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

Submission status: Accepted

Solution code:
N = int(input())

f = False
for n in range(25 + 1):
    t = N - 4 * n
    f |= t >= 0 and t % 7 == 0

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

Submission status: Accepted

Solution code:
n=int(input())
l=[4*i+7*j for i in range(25) for j in range(25) if 4*i+7*j<=100 and (i!=0 or j!=0)]
if n in l:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

s4s = [4 * i for i in range(26)]
s7s = [7 * i for i in range(15)]

for s4 in s4s:
    for s7 in s7s:
        if s4 + s7 == n:
            print('Yes')
            exit()
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

x = 0

while (N - 7*x) >= 0:
    if (N - 7*x) % 4 == 0:
        print('Yes')
        exit()
    x += 1
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 N == 4 * i + 7 * j:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
a=int(raw_input())

flag=0
for i in range(30):
    for k in range(20):
        if i*4+k*7==a:
            flag=1

if flag==1:
    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 'Yes')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3

n = int(input())

res = False
for i in range(30):
    for j in range(20):
        if i * 4 + j * 7 == n:
            res = True

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

Submission status: Accepted

Solution code:
import sys

N = int(input())

for a in range(51):
    for b in range(15):
        if a*4 + b*7 == N:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

Solution code:
N = int(input())

able_flg = False 

for i in range(N) :
    if (N - i * 4) == 0 or ((N - i * 4) > 0 and  (N - i * 4) % 7 == 0) : 
        able_flg = True
        
print("Yes" if able_flg else "No")

Submission status: Accepted

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


print(abc105_b())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
p=-4
g="No"
while p<=n:
    p+=4
    if (n-p)%7==0:g="Yes";break
print(g)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

l = [1,2,3,5,6,9,10,13,17]

print('No' if n in l else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
flg = False
for i in range(n + 1):
    for j in range(n + 1):
        if 4 * i + 7 * j == n:
            flg = True
            break
ans = 'Yes' if flg else 'No'
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
if(n%4==0):
    print('Yes')
elif(n%7==0):
    print('Yes')
else:
    k=n
    flag=0
    while(n>0):
        n=n-4
        if(n%7==0):
            flag=1
            break
    while(k>0):
        k=k-7
        if(n%4==0):
            flag=1
            break
    if(flag==1):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ok = False

def f(n):
    if n == 0:
        global ok
        ok = True
        return
    elif n < 0:
        return
    
    if ok:
        return
    
    f(n-4)
    f(n-7)

f(N)

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

Submission status: Accepted

Solution code:
n=int(input())

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

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

k = 0
for i in range(0,26):
    if (n-i*4)>=0:

        if (n-i*4)%7 == 0:
            k = 1
if k == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
a=N//4
b=N//7

def cal():
    for i in range(a+1):
        for j in range(b+1):
            if i*4+j*7==N: return "Yes"
    return "No"
print(cal())

Submission status: Accepted

Solution code:
import numpy as np
import math

N = int(input())

# N = 4 a + 7 b

DP = []
DP.append(True)

for i in range(1, N+1):
    if (i - 4 >= 0 and DP[i - 4]) or \
       (i - 7 >= 0 and DP[i - 7]):
        DP.append(True)
    else:
        DP.append(False)

if DP[N]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())

a=['Yes']+['No']*100

for i in range(n+1):
	if i>=4 and a[i-4]=='Yes':
		a[i]='Yes'
	if i>=7 and a[i-7]=='Yes':
		a[i]='Yes'
print(a[n])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n <= 3:
    print("No")
elif n == 5 or n == 6 or n == 9:
    print("No")
elif n == 10 or n == 13 or n == 17:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

remain = n%7
remain4s = []
while True:
    remain4 = remain%4
    if remain4 == 0:
        print('Yes')
        break
    else:
        remain += 7
        if remain > n:
            print('No')
            break
    if remain4 in remain4s:
        print('No')
        break
    else:
        remain4s.append(remain4)

Submission status: Accepted

Solution code:
N = int(input())
cnt_max_4 = N // 4
flag = False
for i_4 in range(cnt_max_4+1):
    money_4 = 4 * i_4
    res_money = N - money_4
    if res_money % 7==0:
        flag = True
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())

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

print(kasi(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def f():
  for four in range(0, N//4+1):
    for seven in range (0, N // 7 + 1):
      if 4 * four + seven * 7 == N:
        return 'Yes'
  return 'No'

print(f())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
for i4 in range(25):
    for i7 in range(15):
        if i4*4+i7*7==n:
            print("Yes")
            import sys
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
n = int(input())

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

print("No")

Submission status: Accepted

Solution code:
N = int(input())

def solve(N):
    for i in range(0, N + 1, 4):
        j = N - i
        if j % 7 == 0:
            return True
    return False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
is_ans=0
for i in range(25):
    if is_ans:
        break
    for j in range(14):
        if 4*i+7*j==N:
            is_ans=1
            break
print("Yes" if is_ans else "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"

while n>=0:
    if n%4 == 0:
        ans = "Yes"
        break
    n -= 7
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
for x in range((N//4)+1):
    md=N-4*x
    if md%7==0:
        y=md//7
        if 4*x+7*y==N and x>=0 and y>=0:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
#! usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    n = int(input())

    for i in range(26):
        if (n-i*4) % 7 == 0 and n - i * 4 >= 0:
            print("Yes")
            break

    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
count=0
for i in range(n):
  for j in range(n):
    if 4*i + 7*j ==n:
      count=1

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

N = int(input())

while True:
	if N < 0:
		break
	elif N%4 == 0:
		print('Yes')
		sys.exit()
	N -= 7

print('No')

Submission status: Accepted

Solution code:
def fa(): #final answer
    global ans
    print(ans)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
N = getN()

ans = "No"
maxn = N//4 + 1

for i in range (maxn):
    if (N-4*i) % 7 == 0:
        ans = "Yes"

fa()

Submission status: Accepted

Solution code:
N = int(input())

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

print(Ans)

Submission status: Accepted

Solution code:
n = int(input())

while 0 <= n:
    if n%4 == 0:
        print("Yes")
        exit()
    else:
        n -= 7
print("No")

Submission status: Accepted

Solution code:


def solve(n):
    for i in range(30):
        for k in range(20):
            if i * 4 + 7 * k == n:
                print('Yes')
                return

    print('No')
    return


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

Submission status: Accepted

Solution code:
N = int(input())

import math
def f():
    for i in range(math.floor(N / 7) + 1):
        if 0 == (N - i * 7) % 4: return True
    return False

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

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

Submission status: Accepted

Solution code:
N=int(input().strip())
x=0
while 4*x<=N:
    if (N-x*4)%7==0:
        print("Yes")
        break
    x+=1
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

four = [4*i for i in range(26)]
seven = [7*i for i in range(15)]

exist = False
for f in four:
    for s in seven:
        sm = f+s
        if sm == N:
            exist = True
            
if exist:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
ok = [False for _ in xrange(N+1)]
for i in xrange(4, N+1, 4):
    ok[i] = True
for i in xrange(7, N+1, 7):
    ok[i] = True
for i in xrange(N+1):
    if ok[i] and i + 4 <= N:
        ok[i+4] = True
    elif ok[i] and i + 7 <= N:
        ok[i+7] = True
if ok[N]:
    print "Yes"
else:
    print "No"

Submission status: Accepted

Solution code:
n = int(input())

flag = False

for i in range(0,101,7):
    for j in range(0,101,4):
        if n == i + j:
            flag = True
            break
    if flag:
        break
if flag:
    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:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


# --------------------------------------------

dp = None


def main():
    l = []

    for i in range(100):
        for j in range(100):
            if i * 4 + j * 7 <= 100:
                l.append(i * 4 + j * 7)

    N = int(input())

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("No")

Submission status: Accepted

Solution code:
n = int(input())

no_list = [1,2,3,5,6,9,10,13,17]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N=int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
b = 1
for i in range(25):
    b |= b << 4
for i in range(15):
    b |= b << 7
print('Yes' if (b >> N) & 1 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

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