Problem:
 Score : 200 points    Problem Statement La Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.
Determine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.      Constraints  N is an integer between 1 and 100 , inclusive.         Input Input is given from Standard Input in the following format:  N       Output If there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes ; otherwise, print No .        Sample Input 1 11      Sample Output 1 Yes  If you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.       Sample Input 2 40      Sample Output 2 Yes  If you buy ten cakes, the total will be 4 \times 10 = 40 dollars.       Sample Input 3 3      Sample Output 3 No  The prices of cakes ( 4 dollars) and doughnuts ( 7 dollars) are both higher than 3 dollars, so there is no such way.

Solution (Python):
N = int(input())
counter = 0
for y in range(15) :
    if N >= 7*y :
        if 0.25*(N-7*y) % 1 == 0 :
            print("Yes")
            counter = 1
            break
if counter == 0 :
    print("No")

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

flag = False
if N % 7 == 0 or N % 4 == 0 or N % 11 == 0:
	print('Yes')

else:
	for i in range(14):
		if flag == True: break
		for j in range(25):
			if i * 7 + j * 4 == N:
				print('Yes')
				flag = True
				break
			elif i * 7 + j * 4 > N:
				break
	if flag == False:	print('No')

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

judge = ""

M = int(N/4)

for i in range(M+1):
    if not ((N - 4 * i)%7):
        judge = "Yes"
        break
    else:
        judge = "No"
        
print (judge)

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

s = set()
for i1 in range(26):
  for i2 in range(15):
    s.add( i1*4 + i2*7 )

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

Solution (Python):
n = int(input())
mod = n % 4
if mod == 0:
    print('Yes')
elif mod == 1:
    if n >= 21:
        print('Yes')
    else:
        print('No')
elif mod == 2:
    if n >= 14:
        print('Yes')
    else:
        print('No')
else:
    if n >= 7:
        print('Yes')
    else:
        print('No')

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

a = [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 - 1] == 1:
	print('Yes')
else:
	print('No')

Solution (Python):
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:
        if f+s == N:
            exist = True
            
if exist:
    print("Yes")
else:
    print("No")

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

def main():
    for i in range(100):
        tmp = n - 4 * i
        if tmp % 7 == 0 and tmp >= 0:
            print('Yes')
            return
    print('No')

main()

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

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

count = 0
if N % 4 == 0 or N % 7 == 0:
    print("Yes")
elif N < 4:
    print("No")
else:
    while N > 4:
        N = N - 4
        if N % 7 == 0:
            print("Yes")
            count += 1
            break
    if count == 0:
        print("No")

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

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

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

for i in range(int(N/7) + 1):
    for j in range(int(N/4) + 1):
        if i == 0 and j == 0:
            continue
        if N % (7*i + 4*j) == 0:
            hantei = True
            break

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

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

c, d = 4, 7

def test(n):

    if n < 4:
        return False

    if n == 4 or n == 7:
        return True
    else:
        return test(n - 4) or test(n - 7)
    
if test(N):
    print('Yes')
else:
    print('No')

Solution (Python):



def solve():
    n = int(input())
    l4 = [4 * i for i in range(25)]
    l7 = [7 * i for i in range(15)]
    for a in l4:
        for b in l7:
            if a + b == n:
                print("Yes")
                return
    print("No")

if __name__=="__main__":
    solve()

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

Solution (Python):
N = int(input())
cake = list(range(26))
donut = list(range(15))
count = 0

for i in cake:
    for j in donut:
        if i*4 + j*7 == N:
            count += 1

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

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

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

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

    break

Solution (Python):
def SolveCakesAndDonuts(N):
    for m in range(N/7 + 1):
        r = N - 7*m

        if r%4 == 0:
            print  "Yes"
            break
        if m == N/7:
            print "No"
            
n = input()
SolveCakesAndDonuts(n)

Solution (Python):


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

Solution (Python):


cache = {}

def IsOK(n: int):
    if n in [0, 4, 7]:
        return True
    elif n <= 3:
        return False
    elif n in cache:
        return cache[n]
    else:
        cache[n] = IsOK(n - 4) or IsOK(n - 7)
        return cache[n]

N = int(input())
print("Yes" if IsOK(N) else "No")

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

flag = False

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

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

Solution (Python):
if int(input()) in [4,7,8,11,12,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]:
  print("Yes")
else:
  print("No")

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

Solution (Python):
N = int(input())
def Div(i):
    if i == 1 or i == 2 or i==3 or i==5 or i==6:
        return False
    elif i == 4 or i == 7:
        return True
    else:
        if Div(i-4) or Div(i-7):
            return True
        else:
            return False
print("Yes" if Div(N) else "No")

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

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

Solution (Python):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

cnt = 0

chkflg=False
while cnt * 4 <= n:
    
    if n % 4 == 0 or n % 7 == 0:
        
        chkflg=True
        break
        
    elif (n-cnt * 4) % 7 == 0:
        
        chkflg=True
        break
       
    else:
        
        cnt+=1
           
print("Yes" if chkflg else "No")

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

Solution (Python):
def canbuy(n):
    if n%7==0 or n%4==0:
        return 'Yes'
    else:
        if n<4:
            return 'No'
        else:
            if canbuy(n-7)=='Yes':
                return 'Yes'
            else:
                if canbuy(n-4)=='Yes':
                    return 'Yes'
                else:
                    return 'No'

n=int(input())
print(canbuy(n))

Solution (Python):
def canbuy(n):
    for i in range(int(100/7)):
        tmp = n-7*i
        if tmp==0 or (tmp>3 and tmp%4==0):
            return 'Yes'
    return 'No'

n=int(input())
print(canbuy(n))

Solution (Python):
n = int(input())
a = 0
c = 0
while 7*a <=n:
    b = 0
    while (4*b) <= n-(7*a):
        if (7*a)+(4*b) == n:
            c += 1
            break
        else:
            b += 1
    a += 1
    if c == 0:
        pass
    else:
        break
if c == 1 or n == 4:
    print('Yes')
else:
    print('No')

Solution (Python):
from sys import stdin

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

if N in [1, 2, 3, 5, 6, 9, 10, 13, 17]:
    print('No')
else:
    print('Yes')

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

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

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

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

Solution (Python):
import itertools

def solve(n, a):
    if n < 0:
        return False
    elif n == 0:
        return True
    elif len(a) == 0:
        return False
    elif len(a) == 1:
        return n % a[0] == 0
    elif n % a[0] == 0:
        return True
    else:
        for i in itertools.count(0):
            r = n - i * a[0]
            if r < 0:
                break
            if solve(r, a[1:]):
                return True
    return False

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

    if solve(n, (4, 7)):
        print('Yes')
    else:
        print('No')

main()

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


def judge(N):
    i = 0
    while True:
        if 4 * i > N:
            break
        j = 0
        while True:
            if 4 * i + 7 * j == N:
                return "Yes"
            elif 4 * i + 7 * j > N:
                break
            else:
                j += 1
        i += 1
    return "No"


print(judge(N))

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

for x in range(25):
	for y in range(14):
		a = 4*x + 7*y
		if a == N:
			print("Yes")
			break
	else:
		continue
	break
else:
	print("No")

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

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

Solution (Python):
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:
  print("Yes")
else:
  print("No")

Solution (Python):
def calc(N):
	while N > 0:
		if N % 7 == 0:
			print('Yes')
			return
		N -= 4
	if N == 0:
		print('Yes')
	else:
		print('No')

N = int(input())
calc(N)

Solution (Python):
a = [0]
for i in range(101):
	if i in a:
		a += [i+4,i+7]
n = int(input())
print("Yes" if n in a else "No")

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

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

Solution (Python):
n=int(input())
s={4*i+7*j for i in range(25) for j in range(20) if 4*i+7*j<=100 and (i or j)}
if n in s:
  print("Yes")
else:
  print("No")

Solution (Python):
N = int(input())
li = [4 * i + 7 * j for i in range(26) for j in range(15)]
print(["No","Yes"][N in li])

Solution (Python):
N = int(input())
dp = [0 for i in range(200)]
for i in range(26):
    dp[4 * i] = 1
for i in range(150):
    if(dp[i] == 1):
        dp[i + 7] = 1
if(dp[N]):
    print('Yes')
else:
    print('No')

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    d = [0] * 101
    for i in range(25):
        d[i*4] = 1
    for i in range(7,101):
        if d[i-7] == 1:
            d[i] = 1
    n = I()
    if d[n] == 1:
        return 'Yes'
    return 'No'




print(main())

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

Solution (Python):


n = int(raw_input(""))

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

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

kumi = []
for i in range(4,100,4):
  for j in range(7,100,7):
    if i+j < 100:
      kumi.append(i+j)
if n % 4 == 0 or n % 7 == 0 or n in kumi:
  print("Yes")
else:
  print("No")

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

Solution (Python):
a = int(input())
def keisan(x, y):
	return y-4*x

if a%4==0 or a%11==0:
	print("Yes")
else:
	for i in range(a//4):
		keisan(i, a)
		
		if keisan(i, a)%7==0:
			print("Yes")
			break
	else:
		print("No")

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

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

Solution (Python):
if __name__ == "__main__":
    N = int(input())
    for x in range(0, 100):
        y = N - 4 * x
        if y < 0:
            break
        if y % 7 == 0:
            print ("Yes")
            exit(0)
    print ("No")

Solution (Python):
from sys import stdin
num=int(stdin.readline().rstrip())
ans="No"
if num%7==0 or num%4==0:
	ans="Yes"
if num-7>0 and (num-7)%4==0:
	ans="Yes"
if num-14>0 and (num-14)%4==0:
	ans="Yes"
if num-21>0 and (num-21)%4==0:
	ans="Yes"
print(ans)

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

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

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

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

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

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

Solution (Python):
import sys
N = int(input())
for i in range(N):
    rem = N - 4*i
    if rem < 0:
        continue
    if rem % 7 == 0:
        print("Yes")
        sys.exit(0)
print("No")

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

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

for i in range(25):
	if (i * 4) > N:
		break
	if (N - (i * 4)) % 7 == 0:
		ans = True
		break
		
if ans:
	print('Yes')
else:
	print('No')

Solution (Python):
def solve(n):
    for x in range(n/4+1):
        for y in range(n/7+1):
            if 4*x + 7*y == n:
                return "Yes"
    return "No"

assert solve(11) == "Yes"
assert solve(40) == "Yes"
assert solve(3) == "No"
print solve(input())

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

if( n in {4,7,8,11,12,14,15,16} or n >= 18):
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
L = []
counter = 0
for i in range(26) :
    for j in range(16) :
        l = 4*i + 7*j
        L.append(l)
if N in L :
    print("Yes")
else :
    print("No")

Solution (Python):

import sys

n=int(raw_input())
for i in xrange(n/4+1):
 for j in xrange(n/7+1):
  if i*4+j*7==n:
   print 'Yes'
   sys.exit()
print 'No'

Solution (Python):



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

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

    print('No')


if __name__ == '__main__':
    main()

Solution (Python):

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

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

def f():
  for i in range(0, 100//4 + 2):
    for j in range(0, 100//7 + 2):
      if i * 4 + j * 7 == n:
        return 'Yes'
  
  return 'No'

print(f())

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

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

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

while A>=0:
    if A % 7 == 0:
        print("Yes")
        exit(0)
    A-=4
print("No")

Solution (Python):
n = int(input())
i,ans = 0,"No"
while 7*i<=n:
  if (n-7*i)%4==0:
    ans = "Yes"
    break
  i+=1
print(ans)

Solution (Python):
n=int(input())
flag=False
for i in range(0,101,4):
    for j in range(0,101,7):
        if(i+j==n):flag=True

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

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

print(ans)

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

Solution (Python):
a=int(input())
if a==1 or a==2 or a==3 or a==5 or a==6 or a==9 or a==10 or a==13 or a==17:
	print("No")
else:
	print("Yes")

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

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

Solution (Python):
'''
(n - x) % 4

0 % 4 = 0
7 % 4 = 3
14 % 4 = 2
21 % 4 = 1

21以上なら7を0から3回引くことで4の倍数にできる
'''
n = int(input())
if n >= 21:
    flg = True
else:
    flg = False
    for i in range(21 // 4 + 1):
        for j in range(21 // 7 + 1):
            if 4 * i + 7 * j == n:
                flg = True
                break
print('Yes' if flg else 'No')

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

Solution (Python):
n=int(input());
f=0;
while n>=0:
  if n%7<1:f+=1;
  n-=4;
print("Yes"if f>0 else"No")

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

Solution (Python):
N = int(input())
cMax = round(100 / 4)
dMax = round(100 / 7)
result = "No"
for c in range(cMax):
  for d in range(dMax):
    if 4 * c + 7 * d == N:
      result = "Yes"
      break
print(result)

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

a = 0
while 4 * a <= 100:
    b = 0
    while 4 * a + 7 * b <= 100:
        if (4 * a + 7 * b) == n:
            print("Yes")
            exit()
        b += 1
    a += 1
else:
    print("No")

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

Solution (Python):



def main():
    N = int(input())
    for i in range(26):
        for j in range(16):
            if 4*i + 7*j == N:
                return 'Yes'
    return 'No'


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

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


ans = 'No' if N in [1, 2, 3, 5, 6, 9, 10, 13, 17] else 'Yes'
print(ans)

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

Solution (Python):
n=int(input())
p=0
t=True
while p<26:
    r=n-(7*p)
    if r>=0 and r%4 ==0:
        t=False
        print("Yes")
        break
    p+=1
if t:
    print("No")

Solution (Python):


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

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

if __name__ == '__main__':
    main()

Solution (Python):


N = int(input())

cakes = 4
donuts = 7

for i in range(21):
    for j in range(18):
        if cakes * i + donuts * j == N:
            print('Yes')
            exit()

print('No')

Solution (Python):
from itertools import product

N = int(input())

A = N // 4
B = N // 7

ret = False
for a, b in product(range(A + 1), range(B + 1)):
    p = 4 * a + 7 * b
    if p == N:
        ret = True
        break

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

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

lst = [4, 7]

num = 8

while num <= 100:

    for elem in lst:
        if elem + 4 == num or elem + 7 == num:
            lst.append(num)
            break
    num+=1

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

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

Solution (Python):
N, = map(int, raw_input().split())
a = [0]*200
a[0] = 1
for i in range(0,100):
  a[i+4] = max(a[i+4], a[i])
  a[i+7] = max(a[i+7], a[i])
print "Yes" if a[N]==1 else "No"

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

temp = False;

def fun(n):
	global temp;

	if temp == True:
		return;
	else:
		if n < 0:
			return;
		elif n == 0:
			temp = True;
		else:
			fun( n - 4 );
			fun( n - 7 );

fun(N);

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

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

Solution (Python):


N = int(input())

n_4 = int(N / 4)
n_7 = 0

ans = "No"
while n_4 > 0:
    
    if 4 * n_4 + 7 * n_7 == N:
        ans = "Yes"
        break
    else:
        n_4 -= 1
        if N - (4 * n_4 + 7 * n_7) >= 7: n_7 += 1

if 7 * n_7 == N: print("Yes")
else: print(ans)

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

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

ans = [0, 4, 7, 8, 11, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
    28, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 36, 37, 38, 39, 39, 40, 40, 41,
    42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
    52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60,
    60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 67, 68,
    68, 68, 69, 69, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 74, 74, 74, 75,
    75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81,
    81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 84, 85, 85, 85, 86, 86, 86, 87, 87,
    87, 88, 88, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 91, 92, 92, 92, 92,
    93, 93, 93, 94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 96, 97, 97, 97, 98, 98,
    98, 98, 99, 99, 99, 99, 100, 100, 100, 100, 101, 101, 101, 102, 102, 102,
    102, 103, 103, 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 106, 106,
    107, 107, 107, 107, 108, 108, 108, 109, 109, 109, 110, 110, 110, 110, 111,
    111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 114, 115, 115, 115,
    116, 116, 116, 117, 117, 117, 118, 118, 118, 119, 119, 119, 120, 120, 120,
    121, 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, 124, 125, 125, 126,
    126, 126, 127, 127, 127, 128, 128, 128, 129, 129, 130, 130, 130, 131, 131,
    131, 132, 132, 133, 133, 134, 134, 134, 135, 135, 135, 136, 136, 137, 137,
    138, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 142, 143, 143, 144,
    144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151,
    152, 152, 153, 154, 154, 155, 155, 156, 156, 157, 158, 158, 159, 159, 160,
    161, 162, 162, 163, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171,
    172, 173, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 186, 187, 190,
    191, 194, 198]

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

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

cake = 4
dounatsu = 7

c = list()
d = list()

c.append(0)
d.append(0)
for i in range(1,100):
    if i * cake > 100:
        break
    c.append(i*cake)

for j in range(1,100):
    if j * dounatsu > 100:
        break
    d.append(j*dounatsu)

for i in range(len(c)):
    for j in range(len(d)):
        if c[i] + d [j] == n:
            print("Yes")
            exit()
        else:
            continue
else:
    print("No")

Solution (Python):
N = int(input())
donuts = 7
cakes = 4
answer = 0
def calc1():
  for a in range(0,26):
    for b in range(0,26):
      if donuts * a + cakes * b == N:
        return 'Yes'
      elif donuts * a + cakes * b  > N:
        break
  return 'No'

print(calc1())

Solution (Python):

n=int(input())
count=False
if(n%7==0):
	count=True
for i in range(int(n/7)+1):
	if(n%4==0):
		count=True
	else:
		n-=7
if(count==False):
	print("No")
else:
	print("Yes")

Solution (Python):
A = input()

N = int(A)

list_4 = []
list_7 = []
list_numbers = []

for i in range(0, 25):
  list_4.append(4 * i)

for j in range(0,14):
  list_7.append(7 * j)

for i in range(0, 25):
  for j in range(0, 14):
    list_numbers.append(list_4[i] + list_7[j])

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

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

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

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

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

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

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

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

temp4=[4*i for i in range(25)]
temp7=[7*i for i in range(14)]

temp=list()
flg=False
for i in temp4:
    for j in temp7:
        temp.append(i+j)
        if int(N)==i+j:
            flg=True
            print("Yes")
            exit()

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

Solution (Python):
n = int(input())
for a in range(0,26):
    for b in range(0,15):
        if n == 4 * a + 7 * b:
            print('Yes')
            exit()
else:
    print('No')

Solution (Python):

N=int(input())
A=[4,8,12,16,20,24,7,14,21,11,19,25,15,23,27]
if N>=28:
    print('Yes')
elif N in A:
    print('Yes')
else:
    print('No')

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

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

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

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

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

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

if not flag:
    print("No")

Solution (Python):
pre = []

for i in range(0, 100, 4):
    for j in range(0, 100, 7):
        pre.append(i + j)

if int(input()) in pre:
    print("Yes")
else:
    print("No")

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

Solution (Python):
N = int(input())
L = [False] * 101
for i in range(30):
    for j in range(30):
        d = i*4 + j*7
        if d>100:
            break
        else:
            L[d] = True
print("Yes" if L[N] else "No")

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

Solution (Python):
def calc(n):
    ok_list = []
    for i in range(1, 25):
        for j in range(1, 15):
            if (7*j+4*i) <= 100:
                ok_list.append(7 * j + 4 * i)

    if n % 11 == 0 or n % 4 == 0 or n % 7 == 0 or n in ok_list:
        ans = 'Yes'
    elif n < 4:
        ans = 'No'
    else:
        num7 = int(n / 7)
        num4 = int(n / 4)
        n_7 = n - num7 * 7 
        n_4 = n - num4 * 4 
        if n_7 % 4 == 0 or n_4 % 7 == 0:
            ans = 'Yes'
        else:
            ans = 'No'
    return ans 


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

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

b = n//7    
for i in range(b+1):
  M = 7*i
  if (n-M) % 7 == 0:
    res += 1  
    
if res == 0 or n == 0:
  print("No")
else:
  print("Yes")

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

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

if(N%4==0 or  N%7==0):
    print('Yes')
    exit(0)

n=N%7
while(n<N):
    if(n%4==0):
        print('Yes')
        exit(0)
    else:
        n+=7

print('No')

Solution (Python):
N = int(input())
ans = "No"
if 3 < N:
    if (N % 4 == 0) or (N % 7 == 0):
        ans = "Yes"
    elif ((N % 4) % 7 == 0) or ((N % 7) % 4 == 0):
        ans = "Yes"
    x = 0
    while x <= N:
        x += 4
        if (N - x) % 7 == 0:
            ans = "Yes"
            break 
print(ans)

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

a = [False]*107

a[4-1] = True
a[7-1] = True

for i in range (100) :
   if a[i] == True :
      a[i+4] = True
      a[i+7] = True

if a[n-1] == True :
   print('Yes')
else :
   print('No')