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

if n%7 != 0 and n%4 != 0 and n%11 != 0:
    for a in range(1, 25):
        for b in range(1, 14):
            if n%(7*b + 4*a) == 0:
                print('Yes')
                sys.exit()
else:
    print('Yes')
    sys.exit()
print('No')

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

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

if __name__=='__main__':
    main()

Solution (Python):
N=int(input())
count=0
for i in range(15):
    for k in range(26):
        if 7*i+4*k==N:
            while count==0:
                print('Yes')
                count=1
               
    
if count==0:
    print('No')

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

for i in range(N + 1):
    f, s = i, N - i

    if f % 4 == 0 and s % 7 == 0:
        print("Yes")
        exit()

print("No")

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

ans = 'No'
for c in range(25+1):
    for d in range(14+1):
        if 4*c + 7*d == N:
            ans = 'Yes'
            break
    else:
        continue
    break

print(ans)

Solution (Python):
n = int(input())
a = [4 * i for i in range(n)]
b = [7 * i + x for x in a for i in range(n)]

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

Solution (Python):
def buy(n,cake,donut):
  cost = cake*4 + donut*7
  if cost == n:
    return True
  elif cost > n:
  	return False
  else:
    if ((n - cost) % 4) == 0 or ((n - cost) % 7) == cost:
      return True
    else:
      return buy(n,cake+1,donut) or buy(n,cake,donut+1)

n = int(input())
if buy(n,0,0):
  print('Yes')
else:
  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")
                quit()
            else:
                pass
print("No")

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

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

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

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

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

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

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

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

print(ans)

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

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

print(ans)

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

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

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

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

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

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

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

exists = False

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

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

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

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

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

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

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

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

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

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

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

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

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


if __name__ == "__main__":
  main()

Solution (Python):
import itertools

N = int(input())

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

print(ans)

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

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

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

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

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

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

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

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

Solution (Python):

N = int(input())

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

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

Solution (Python):

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




if __name__ == '__main__':
    main()

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

print(ans)

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

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

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

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

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

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

Solution (Python):
import itertools

N = int(input())

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

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

print('No')

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

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

YES = "Yes"  
NO = "No"  

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


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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

n = int(input())

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

print("No")

Solution (Python):



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




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

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

Solution (Python):
price = []
N = int(input())
for i in range(N//4 + 1) :
    for j in range(N//7 + 1) :
        price.append(i*4+j*7)

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

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

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

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

n = int(input())

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

print('No')

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

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

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

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

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

Solution (Python):
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit()
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit()
    n2 -= 4
print("No")

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

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

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())
memo=[]
for i in range(26):
    for j in range(15):
        memo.append(i*4+j*7)
if N in memo:
    print('Yes')
else:
    print('No')

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

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

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

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

print('No')

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

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

ans = 'No'

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

print(ans)

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

Solution (Python):



n = int(input())
count = 0
for i in range(25+1):
  for j in range(17+1):
    if 4*i+7*j == n:
      count = count+1
if count > 0:
  print("Yes")
else:
  print("No")

Solution (Python):

n = int(input())

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

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

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

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

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

Solution (Python):

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

Solution (Python):

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import math
import itertools

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

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

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

    print('No')

Solution (Python):
import math

n = int(input())


for c in range(0,math.floor(n/4)+1,1):
  
  for d in range(0,math.floor(n/7)+1,1):
    if c*4 + d*7 == n:
      print('Yes')
      exit()
      
print('No')

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

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

values = [i*4 + j*7 for i in range(25) for j in range(16)]
print('Yes' if n in values else 'No')

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

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

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

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

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

print(ans)

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

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

Solution (Python):


n = int(input())
count = 0

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

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

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

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

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

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

print("No")

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

cake = n // 4

for i in range(cake + 1):
  cake_money = i * 4
  donut_money = n - cake_money
  if donut_money >= 0 and donut_money % 7 == 0:
    print("Yes")
    break
else:
  print("No")

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

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

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

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

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

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

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

if __name__ == '__main__':
    main()

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

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

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=int(input())

ans = "No"

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

print(ans)

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

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

print('No')

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

N = read_int()[0]

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

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

Solution (Python):
n = int(input())
ans = "No"

for i in range(n // 4 + 1):
  for j in range(n // 7 + 1):
    if 4 * i + 7 * j == n:
      ans = "Yes"
      break
  else:
    continue
  break
print(ans)

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

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

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

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

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

print('No')

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

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

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

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

print('No')

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

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

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

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

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

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

else:
    print('No')

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

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

else:
    print('No')

Solution (Python):


n = int(input())
count = 0

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

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

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

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

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

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

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

count=0
for i in range(30):
    for j in range(20):
        total = 4*i + 7*j
        if(total==N):
            count+=1

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

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):
N=int(input())
cnt=0

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

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

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

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

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

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

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

print(answer)

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

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

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

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

Solution (Python):

import sys
import itertools
import collections
import functools
import math
from queue import Queue

INF = float("inf")


def yes():
    print("Yes")  


def no():
    print("No")  


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

    return


def main():

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


if __name__ == '__main__':
    main()

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

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

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

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

print(ans)

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

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

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

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

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

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

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

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

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

main()

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

Solution (Python):



n = int(input())

ans = "No"
for i in range(0, 100, 4):
    for j in range(0, 100, 7):
        if i + j == n:
            ans = "Yes"
            break

print(ans)

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

Solution (Python):
N = int(input())
if N % 2:
    N -= 7
if N % 4:
    N -= 14
if N >= 0:
    print("Yes")
else:
    print("No")

Solution (Python):
N = int(input())
print('Yes' if N in [4 * c + 7 * d for c in range(N // 4 + 1) for d in range(N // 7 + 1)] else 'No')

Solution (Python):
n = int(input())
flag = 0
for cake in range(n//4 + 1):
    for donuts in range(n//7 + 1):
        if cake*4 + donuts*7 == n:
            flag = 1
            break
    if flag == 1:
        break
if flag == 0:
    print("No")
else:
    print("Yes")

Solution (Python):
import sys
N = int(input())
for i in range(100):
    for j in range(100):
        if( N == (4*i+7*j) ):
            print('Yes')
            sys.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(0)
print("No")

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