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

Solution (Python):

import sys

N = int(input())

def getAns(n) :
    total = 0
    for i in range(n) :
        for j in range(n) :
            total = i * 4 + j * 7
            if total == n :
                return "Yes"
    return "No"

print(getAns(N))

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

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

if n in arr:
    print("Yes")
else:
    print("No")

Solution (Python):
n= int(input())
if 4*(2*n//7) -n>=0:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
N=int(input())
ans='No'
for n in range(N//4+1):
    if ans=='Yes':
        break
    for m in range(N//7+1):
        if N==4*n+7*m:
            ans='Yes'
            break
print(ans)

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

ans = 'No'

for n in range(N//7+1):
    if ans == 'Yes':
        break
    for m in range(N//4+1):
        if N == 7*n + 4*m:
            ans = 'Yes'
            break

print(ans)

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

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

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

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

Solution (Python):
N = int(input())
count=0
for i in range(26):
  for j in range((100-4*i)//7+1):
    M = N-4*i-7*j
    if(M==0):
      print('Yes')
      count+=1
      break
  if(count==1):
    break
if(count==0):
  print('No')

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

amount = 0
result = False

i_max = int(N/4) + 1
y_max = int(N/7) + 1


for i in range(0, i_max) :
    for j in range(0, y_max) :
        cake   = 4 * i
        donuts = 7 * j
        amount = cake + donuts

        if amount == N:
            result = True
            break

    else:
        continue
    break

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

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

maxI = (N // 4)+1 
maxJ = (N // 7)+1

flag = False
for i in range(maxI):
    for j in range(maxJ):
        total = 4*i + 7*j
        if total == N:
            flag = True
            break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
while(True):
    if(n%4==0 or n%7==0):
        print('Yes')
        exit()
    elif(n<4):
        print('No')
        exit()
    else:
        n-=7

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

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

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

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

Solution (Python):

import sys

N = int(input())

def iter(n):
    if n == 0:
        print("Yes")
        sys.exit(0)
    elif n > 0:
        iter(n-4)
        iter(n-7)
    else:
        return False

iter(N)
print("No")

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

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

count = 0
for c in range(0, n + 1, 4):
    for cd in range(c, n + 1, 7):
        if cd == n:
            count = 1

print(['No', 'Yes'][count])

Solution (Python):


LI = [0, 4, 7, 8, 12, 14, 16, 20, 21, 24, 11, 15, 19, 23, 27, 18, 22, 26, 25]

def main():
    n = int(input())
    print("Yes" if n % 28 in LI else "No")

main()

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


main()

Solution (Python):
def check(n):
    if n == 0:
        return True
    if 0 > n:
        return False
    return any([check(n - 4), check(n - 7)])


def main():
    if check(int(input())) is True:
        print('Yes')
    else:
        print('No')


main()

Solution (Python):
N =int(input())
s=False
l =[7*i for i in range(4)]
for i in range(26):
    for j in l:
        if j+4*i==N:
            s =True
            break
if s:
    print("Yes")
else:
    print("No")

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

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

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

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

Solution (Python):
"""AtCoder"""

import sys
input = sys.stdin.readline

l = []
N = int(input())

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

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

Solution (Python):


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

    ct = [0] * 128

    for i in range(0, 7 * 4, 7):
        for j in range(0, 104, 4):
            ct[i + j] = 1


    print('Yes' if ct[N] == 1 else 'No')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
for i in range(100 // 4 + 1):
    for j in range(100 // 7 + 1):
        if 4 * i + 7 * j == N:
            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):
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(0)
else: print('No')

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

counter = 0
for number_cake in range(0,N):
	for number_donut in range(0,N):
		if(N == number_cake*4+number_donut*7):
			counter += 1

if(counter > 0):
	print("Yes")
else:
	print("No")

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

Solution (Python):
def main():
    n = int(input())
    result = False
    sum = 0
    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")
    exit()


if __name__ == '__main__':
    main()

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

ans = 'No'
for i in range(n + 1):
    if i % 4 == 0:
        if (n - i) % 7 == 0:
            ans = 'Yes'
            break

print(ans)

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

Solution (Python):
n = int(input())
memo ={}
for i in range(30):
  for j in range(30):
    memo[7*i+4*j]=1


del memo[0]

print("Yes" if n in memo else "No")

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

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

Solution (Python):

N = int(input())
cMax = N // 4
dMax = N // 7
found = False
for c in range(cMax+1):
    for d in range(dMax+1):
        if c*4+d*7==N:
            found = True
            break
    if found: break

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

Solution (Python):
a=int(input())
b=[1,2,3,5,6,9,10,13,17]
print("Yes"if a%28 not in b or a>27else"No")

Solution (Python):
N = int(input())
div4 = int(N/4) + 1
div7 = int(N/7) + 1

flg = False
for i in range(div4):
  sum = i * 4
  for t in range(div7):
    sum += t * 7
    if(N == sum):
      flg = True
      
      
if(flg):
  print("Yes")
else:
  print("No")

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

Solution (Python):

n = int(input())

can = False

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

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

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

Solution (Python):
def piyo():
    n = int(input())
    if n>=24:
        if ((n-7)%4==0 or (n-14)%4==0 or (n-21)%4==0 or n%4==0
        or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or (n-24)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=21:
        if ((n-7)%4==0 or (n-14)%4==0 or (n-21)%4==0 or n%4==0
        or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=20:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or (n-20)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=16:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or (n-16)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=14:
        if ((n-7)%4==0 or (n-14)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=12:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or (n-12)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=8:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or (n-8)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=7:
        if ((n-7)%4==0 or n%4==0 or (n-4)%7==0 or n%7==0):
            print("Yes")
            return
    if n>=4:
        if (n%4==0 or (n-4)%7==0 or n%7==0):
            print("Yes")
            return
    print("No")
        
if __name__ == '__main__':
    piyo()

Solution (Python):
N = int(input())
for x in range(100//4+1):
	for y in range(100//7+1):
		if 4 * x + 7 * y == N:
			print('Yes')
			exit(0)
else:
	print('No')

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

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

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

print("No")

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

a=0
flag = False

while a<=N:
    if (N-a)%7==0:
        flag=True
    a+=4

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

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

Solution (Python):

N = int(input())

ans = "No"
for d in range(N//7 + 1):
    if (N - 7*d)%4 == 0:
        ans = "Yes"
print(ans)

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

if N >= 28:
    print("Yes")
else:
    fou = []
    sev = []
    for num in range(5):
        fou.append(7*(num))
    for num in range(8):
        sev.append(4*(num))
    sum = []
    for i in range(7):
        for j in range(4):
            sum.append(sev[i] + fou[j])
    if N in sum:
        print("Yes")
    else:
        print("No")

Solution (Python):
import sys

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

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


def boughter(num):

    if num<-5:

        return
    elif num==0:
        print('Yes')
        exit(0)
    boughter(num-4)
    boughter(num-7)
    return

boughter(N)
print ( 'No' )

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

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

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

print(ans)

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

Solution (Python):
import sys

target = int(sys.stdin.readlines()[0].strip())

value_cake = 4
value_donut = 7
flag = False

for num_cake in range(0, target // value_cake + 1):
  for num_donut in range(0, target // value_donut + 1):
    if num_cake * value_cake + num_donut * value_donut == target:
      flag = True

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

Solution (Python):
N = int(input())
list = []
for j in range(26):
    for k in range(16):
        total = 4 * j + 7 * k
        list.append(total)

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

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

Solution (Python):



def main():
    """Function."""
    n = int(input())

    check = set()
    for i in range(26):
        for j in range(15):
            temp = 4 * i + 7 * j
            if temp > 100:
                pass
            else:
                check.add(temp)

    check.remove(0)

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


if __name__ == "__main__":
    main()

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

Solution (Python):

import sys
N = int(input())
for i in range(0,N+1,4):
    for k in range(0,N+1,7):
        if i + k == N:
            print("Yes")
            sys.exit()
print("No")

Solution (Python):

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

Solution (Python):
def main():
    n = int(input())
    for i in range(0, n + 1, 4):
        if (i - n) % 7 == 0:
            print('Yes')
            return
    print('No')


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
flag = 0
cou = N//4 +1

if N < 4:
    print("No")

else:
    for i in range(cou):
        N2 = N - 4*i

        if N2 < 0:
            break

        elif N2 % 7 == 0:
            print("Yes")
            flag = 1
            break

        else:
            continue 

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

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

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

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

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

Solution (Python):
N = int(input())
list = []
y = 0
while N - 7*y >=0:
    if (N - 7*y)%4 == 0:
        x = (N - 7*y)%4
        list.append(x)
        y +=1
    else:
        y +=1
        continue
        
if list == []:
    print('No')
else:
    print('Yes')

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

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

Solution (Python):
N = int(input())
L = list(range(0,26))
c = 0
for i in L:
    for j in L:
        if 4*i+7*j==N:
            c+=1
if c>0:
    print("Yes")
else:
    print("No")

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

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

if n < 4: 
  print("No")

elif n % 4 == 0 or n % 7 == 0:  
  print("Yes")
else:
  four_max = n // 4

  m = 1
  ans = False
  while m < four_max + 1:
    if (n - (4*m)) % 7 == 0:
      ans = True
      break
    m = m+1

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

Solution (Python):
import sys

targetPrice = int(input())
cakePrice = 4
donutPrice = 7
maxDonutCount = int(targetPrice / 7)

for i in range(maxDonutCount + 1):
    targetCakePrice = targetPrice - (donutPrice * i)
    if targetCakePrice % cakePrice == 0:
        print("Yes")
        sys.exit()
print("No")

Solution (Python):




def  existCheck(cakePrice,donutPrice,total):
	buyPattern = "No"
	cakeRange = range(0,(total//cakePrice)+1)
	donutRange = range(0,(total//donutPrice)+1)
	for cake in cakeRange:
		totalPrice = 0
		for donut in donutRange:
			if total-cakePrice*cake-donutPrice*donut == 0:
				buyPattern = "Yes"
				break

	answer = buyPattern
	return answer


if __name__ == '__main__':
	total = int(input())
	cakePrice = 4
	donutPrice = 7
	solution=existCheck(cakePrice,donutPrice,total)
	print(solution)

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

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

print('No')

Solution (Python):
N = input()
flg = False
for i in range(0,N+1):
  for j in range(0,N+1):
    if 4*i + j*7 == N:
      flg = True
      print 'Yes'
      break
  if flg == True:
    break
if flg==False:
  print 'No'

Solution (Python):
N=int(input())
fourK = 0
fourLen=[]
sevenK = 0
sevenLen=[]
while fourK <= N:
    fourLen.append(fourK)
    fourK += 4
while sevenK <= N:
    sevenLen.append(sevenK)
    sevenK += 7
x=fourLen[0] + sevenLen[0]
for f in fourLen:
    for s in sevenLen:
        if N == f + s:
            print("Yes")
            exit()
print("No")

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

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

for x in range(100):
    for y in range(100):
        t = 4*x + 7*y
        if t == n :
            print("Yes")
            exit(0)

print("No")

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

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

        break

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

Solution (Python):
import sys




N = int(input())
s = [0, 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 ]
if N in s:
    print("Yes")
else:
    print("No")

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

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

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

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

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

Solution (Python):
n = int(input())
cnt = False
for i in range (26):
  for j in range (19):
    s = i*4 + j*7
    if s == n:
      cnt = True
      break
  if cnt:
    break



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

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

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

if N % 4 == 0 or N % 7 == 0:
    f = 1
else:
    while N > 4:
        N -= 4
        if N % 7 == 0:
            f = 1
            break

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

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

def searcher(n):
	a, b = 0, 0
	while b*7 <= n:
		if (b*7) == n:
			return True
		a = 0
		while a*4 + b*7 <=n:
			if a*4 + b*7 == n :
				return True
			a += 1
		b += 1
	else:
		return False


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

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

list=[]
for i in range(100):
    for j in range(100):
        cost=4*i+7*j
        if cost<=100:
            list.append(cost)

ans=0
for i in range(len(list)):
  if n==list[i]:
    ans=1
    
print('Yes' if ans==1 else 'No')

Solution (Python):
n = int(input())
xm = n//4
ym = n//7
for x in range(xm+1):
    for y in range(ym+1):
        if 4*x+7*y == n:
            print('Yes')
            exit()
print('No')

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

yes_or_no = False
for i in range(15):
    for j in range(26):
        if 7 * i + 4 * j == n:
            yes_or_no = True

            break

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

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

def main():
    l = [x + y for x in range(N + 1) if x % 4 == 0
               for y in range(N + 1) if y % 7 == 0]
    l = list(set(l))
    ans = "Yes" if l.count(N) else "No"
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

n = int(input())
flag = False
for a in range(int(100/4)+1):
    if flag:
        break

    for b in range(int(100/7)+1):
        
        if 4*a+7*b == n:
            flag = True
            break
        if 4*a+7*b > n:
            next

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

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

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

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

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

            break

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

Solution (Python):

n=int(input())

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

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

ans = 0

while N>=0:
    if N%4==0:
        ans = ans+1
    N = N-7

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

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

print('No')

Solution (Python):
N = int(input())
for donuts in range(15):
    for cake in range(26):
        if 4 * cake + 7 * donuts == N:
            print('Yes')
            exit()
print('No')

Solution (Python):
def main() :
	N = int(input())
	
	while N > 0 :
		if (N % 7 == 0 or N % 4 == 0) :
			return "Yes"
		N = N-7

	return "No"

print(main())

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

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()

fourseven = set([0])

for f in range(30):
    for s in range(20):
        fourseven.add(4*f + 7*s)
    
print('Yes') if n in fourseven else print('No')

Solution (Python):
import sys

N=int(input())
if N%4==0:
    print("Yes")
    sys.exit()

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

else:
    print("No")

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

for a in range(0,N+1,4):
    for b in range(a,N+1,7):
        if b == N:
            print('Yes')
            exit()
print('No')

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

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

if __name__ == "__main__":
    main()

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

for x in range(0, 101, 4):
    for y in range(0, 101, 7):
        if x + y == N:
            print('Yes')
            exit(0)
        elif x + y > 100:
            break
print('No')

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

Solution (Python):
N = int(input())
cake = int(N/4)
donuts = int(N/7)

for i in range(donuts+1):
    for m in range(cake+1):
        sum_price = i*7 + m*4
        if N == sum_price:
            print('Yes')
            exit()

print('No')

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

Solution (Python):
n = int(input())
i = 0
while True:
    if 4*i > n:
        break
    j = 0
    while True:
        if 4*i + 7*j == n:
            print('Yes')
            exit()
        elif 4*i + 7*j > n:
            break
        j += 1
    i += 1
print('No')

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

f=0

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

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

Solution (Python):
n = int(input())
coins = [4, 7]
m = len(coins)
dp = [[False for j in range(n + 1)] for i in range(m + 1)]
dp[0][0] = True

for i in range(1, m + 1):
    for j in range(0, n + 1):
        dp[i][j] = dp[i - 1][j]
        if j - coins[i - 1] >= 0:
            dp[i][j] |= dp[i][j - coins[i - 1]]

print('Yes' if dp[m][n] else 'No')

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

Solution (Python):
def judge(a):
    global flg
    if a % 4 == 0 or a % 7 == 0:
        flg = 1

N = int(input())
flg = 0
judge(N)

while N > 7:
    N -= 7
    judge(N)

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

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

Solution (Python):
import sys
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")
            sys.exit()
print("No")

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

if a <= 3:
  print("No")
else:
  while a >= 0:
    if a % 4 == 0:
      print("Yes")
      break
    else:
      a -= 7
  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):
money = int(input())

while money >= 4:
    if money % 7 == 0 or money % 4 == 0:
        money = 0
    else:
        money -= 4

print("Yes" if money == 0 else "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())
a=-(-n//4)
for i in range(a+1):
	b=(a-i)*4
	for j in range(a+1):
		if b+7*j==n:
			print('Yes')
			exit()
print('No')

Solution (Python):
import sys
n=int(input())
if(n%7==0):
  print("Yes")
  sys.exit(0)
while(1):
    if(n%4==0):
        print("Yes")
        sys.exit(0)
    n-=7
    if(n<=3):
        break
print("No")

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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

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

    print(No)


if __name__ == '__main__':
    main()

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

Solution (Python):
import math

n=int(input())
a=7
b=4
for i in range(math.floor(n/a)+1):
  if (n-a*i)%b==0:
    print('Yes')
    exit()
print('No')

Solution (Python):
from sys import stdin


def main() -> None:
    n = int(next_str())
    print(("No", "Yes")[judge(n)])


def judge(n: int) -> bool:
    price_c = 4
    price_d = 7

    for c in range(0, n // price_c + 1):
        for d in range(0, n // price_d + 1):
            if c * price_c + d * price_d == n:
                return True

    return False


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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


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

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