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())
if N%7==N and not N%4==0:
  print('No')
elif N%4==0 or N%7==0:
  print('Yes')
else:
  A = 'No'
  while N>7:
    N -= 7
    if N%4==0:
      A = 'Yes'
  print(A)

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

Solution (Python):
def cracker(n):
    i = 0
    while True:
        r = (n - i * 4)
        if r < 0:
            print('No')
            return
        if (n - i * 4) % 7 == 0:
            print('Yes')
            return
        i += 1
n = int(input())
cracker(n)

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

for x in range(25):
    for y in range(15):

        if x*4 + y*7 == N:
            ans = "Yes"
            
print(ans)

Solution (Python):

n = int(input())
for donut in range(16):
    for cake in range(26):
        if donut * 7 + cake * 4 == n:
            print('Yes')
            exit()
print('No')

Solution (Python):
n = int(input())
def buy(m):
  if m == 0:
    print("Yes")
    exit()
  if m < 0:
    return None
  buy(m-4)
  buy(m-7)
buy(n)
print("No")

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

for i in range(50):
    for j in range(30):
        t = 4*i + 7*j
        if t == n:
            ans = 1
            break

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

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

print("No")

Solution (Python):
N = int(input())
xmax = N//4
ymax = N//7
for x in range(0,xmax+1):
    for y in range(0,ymax+1):
        ans = 4*x + 7*y
        if ans > N:
            continue
        if N == ans:
            print("Yes")
            exit()
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 = int(input())
for i in [1, 2, 3, 5, 6, 9, 10, 13, 17]:
    if N == i:
        print('No')
        exit()
print('Yes')

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')
            exit()
print('No')

Solution (Python):
N = int(input())
L = [0 for i in range(200)]
L[0] = 1

for i in range(101):
	if L[i] == 1:
		L[i + 4] = 1
		L[i + 7] = 1

if L[N] == 1:
	print("Yes")
else:
	print("No")

Solution (Python):
n=int(input())
i=0
while n-7*i>=0:
    m=n-7*i
    if m%4==0:
        print('Yes')
        exit()
    else:
        i+=1
print('No')

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

for k in range(n):
    for l in range(n):
        if 4*k + 7*l == n:
            print('Yes')
            sys.exit()

print('No')

Solution (Python):


n  = int(input())

res='No'
while(n>0):
  if n%4==0:
    res='Yes'
    break
  n=n-7
  if n==0:
    res='Yes'
    break
print(res)

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

Solution (Python):
n = int(input())
ok = 0
i = 0
while i <= n // 4:
    j = 0
    while j <= n // 7:
        if 4*i + 7*j == n:
            ok = 1
        j += 1
    i += 1
if ok == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
n=int(input())
cnt=0
for a in range(26):
    for b in range(15):
        if n==4*a+7*b:
            cnt+=1
if cnt>=1:
    print("Yes")
else:
    print("No")

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

Solution (Python):
n = int(input())
cake_limit = n//4 + 1
dough_limit = n//7 + 1
flag = True
for i in range(cake_limit):
    for ii in range(dough_limit):
        if 4*(i) + 7*(ii) == n and flag:
            print("Yes")
            flag = False
if flag:
    print("No")

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

Solution (Python):
N = int(input())
for i7 in range(20):
    for i4 in range(30):
        if i7 * 7 + i4 * 4 == N:
            print('Yes')
            break
    else:
        continue
    
    break
else:
    print('No')

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

Solution (Python):
N = int(input())
do_num = int(N/7)
yn = False
for n in range(do_num+1):
    if (N-7*n) % 4 == 0:
        yn = True
        break
    else:
        yn = False

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

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

if N % 4 == 0:
    print("Yes")
elif N > 6 and (N-7) % 4 ==0:
    print("Yes")
elif N > 13 and (N-14) % 4 ==0:
    print("Yes")
elif N > 20 and (N-21) % 4 ==0:
    print("Yes")
else:
    print("No")

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

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

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

for i4 in range(25):
    for i7 in range(15):
        if n == i4 * 4 + i7 * 7:
            print('Yes')
            quit()

print('No')

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

for b in range(N // 7 + 1):
    if (N - (b * 7)) % 4 == 0:
        print("Yes")
        exit(0)
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())

flg=0
for a in range(N):
    for b in range(N):
        if 4*a + 7*b == N :
            flg += 1  
print("Yes" if flg != 0 else "No")

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

flag = 0
for A in range(50):
    for B in range(15):
        if (4*A + 7*B == N):
            flag = 1

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

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

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

Solution (Python):
N = int(input())
cake = 4
donut = 7
ac = False
for i in range(25):
    for j in range(14):
        if N == (cake * i + donut * j):
            ac = True
            break
if ac:
    print('Yes')
else:
    print('No')

Solution (Python):
N = int(input())
cake = 4
donut = 7
ac = False
for i in range(25):
    for j in range(14):
        if N == (cake * i + donut * j):
            ac = True
if ac:
    print('Yes')
else:
    print('No')

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

if n % 4 == 0:
	print("Yes")
elif n % 4 == 1 and n >= 21:
	print("Yes")
elif n % 4 == 2 and n >= 14:
	print("Yes")
elif n % 4 == 3 and n >= 7:
	print("Yes")
else:
	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())
ans = 'No'


def buy(money):
    if money == 0:
        print('Yes')
        quit()
    elif money < 0:
        return
    buy(money - 4)
    buy(money - 7)


buy(n)
print('No')

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

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

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

for cake in range(25+1):
    for donut in range(15+1):
        if n == cake*4 + donut*7:
            print("Yes")
            sys.exit()
print("No")

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

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

Solution (Python):
four_w = []
seven_w = []
cross = []

for i in range(1,101):
    if i % 4 == 0:
        four_w.append(i)
    elif i % 7 ==0:
        seven_w.append(i)

for four in four_w:
    for seven in seven_w:
        cross.append(four + seven)

n = int(input())

if n in cross:
    print("Yes")
elif n in seven_w:
    print("Yes")
elif n in four_w:
    print("Yes")
else:
    print("No")

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

X=list(range((N//4)+1))
Y=list(range((N//7)+1))

flag=0
tmp=0

for x in X:
    if flag==1:
        break
    for y in Y:
        if int(4*x + 7*y)==N:
            flag=1
            print('Yes')
            break
    else:
        pass

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

Solution (Python):
import math
n = int(input())
ans = 'No'
for i in range(math.ceil(n/4)+1):
    for j in range(math.ceil(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 7*i + 4*j == n:
            ans = 'Yes'
print(ans)

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

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


solve()

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

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

Solution (Python):
import sys


def solve(N):
    hantei = 0
    for i in range(26):
        for j in range(20):
            if 4*i + 7*j == N :
                hantei = 4*i + 7*j
    if hantei == N :
        return ('Yes')
    else :
        return('No')

def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

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

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

Solution (Python):

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

Solution (Python):

n = int(input())
n_max = 100
cake = 4
donut = 7
s = set()
for i in range(int(n_max/cake)+1):
    for j in range(int(n_max/donut)+1):
        s.add(4*i+7*j)
if n in s:
    print ('Yes')
else:
    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):
"""
B - Cakes and Donuts
ABC 洋菓子店では, 
1 個 4 ドルのケーキと 
1 個 7 ドルのドーナツが売られている.
このとき, 合計金額が N ドルとなる買い方はあるか, 判定せよ. 
ただし, 同じ商品を二個以上買っても良く,
 買わない商品があっても良いものとする. 
"""

N = int(input())

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

Solution (Python):
N = int(input())
ans = 'No'
while N > 0:
    if N % 4 == 0:
        ans = 'Yes'
        break
    N -= 7
if N == 0:
    ans = 'Yes'

print(ans)

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

for i in range(25):
    for j in range(14):
        if N == 4 * i + 7 * j:
            accept = True

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

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

Solution (Python):
can_buy = []

for n in range(101):
    for d in range(15):
        remnant = n-7*d
        if remnant >= 0 and remnant % 4 == 0:
            can_buy.append(n)
            break

n = int(input())

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

Solution (Python):


def no_change(N):
    while N > 0:
        if N%7 == 0 or N%4 == 0:
            return 'Yes'
        N -= 4    
    else :
        return 'No'


N = int(input())


print(no_change(N))

Solution (Python):
import sys
import io



def solve(N): 
    hantei = 0
    for i in range(26):
        for j in range(20): 
            if 4*i + 7*j == N : 
                hantei = 1
    if hantei == 1:            
        return('Yes')
    else: 
        return('No')
    

def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

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

for a in range(100//7):
 for b in range(100//4):
  if N==(a*7+b*4):
   flag=1
   break

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

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

while N > 0:
    if N%7 == 0 or N%4 == 0:
        print('Yes')
        break
    N -= 4

else :
    print('No')

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

while N > 0:
    if N%7 == 0 or N%4 == 0:
        print('Yes')
        break
    N -= 4

else :
    print('No')

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

isok = False
for i in range(0,101,4):
    for j in range(0,101,7):
        if i+j==N:
            
            isok = True
            break
    if isok: break
        
if isok:
    print("Yes")
else:
    print("No")

Solution (Python):
n = int(input())
max = (n//4)+1
index=0
flag =0
while index<max:
    sum=index*4
    if (n-sum)>=0 and (n-sum)%7==0:
        print("Yes")
        flag=1
        break
    index+=1
if flag ==0:
    print("No")

Solution (Python):
N=int(input())
a=N//4
b=N//7
for i in range(a+1):
  for j in range(b+1):
    if i*4+j*7==N:
      print('Yes')
      exit()
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 = int(input())
count = 0
for i in range(0,25):
    for j in range(0,25):
        if 4*i + 7*j == n:
            count = 1
if count == 1:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
n = int(input())
for i in range(16):
    if n%4 == 0:
        print("Yes")
        quit()
    n -= 7
    if n < 0:
        break
print("No")

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

Solution (Python):
N = int(input())
m = 0
for i in range(15):
  n = N-7*m
  if n < 0:
    print("No")
    break
  elif n % 4 == 0:
    print("Yes")
    break
  elif m == 14:
    print("No")
  m += 1

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

Solution (Python):
import sys
n = input()
for i in range(0,101,4):
	if (n-i)%7 == 0 and n >= i:
		print "Yes"
		sys.exit(0)
print "No"

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):
a=set()
for i in range(26):
    for k in range(15):
        a.add(i*4+k*7)
n=int(input())
if n in a:
    print("Yes")
else:
    print("No")

Solution (Python):
a=set()
for i in range(26):
    for k in range(15):
        a.add(i*4+k*7)
n=int(input())
if n in a:
    print("Yes")
else:print("No")

Solution (Python):
n = int(input())
n_4,n_7,end = 0,0,0
while n_4*4 <= n:
    n_7  = 0
    while n_7*7 + n_4*4 <= n:
        if n_7*7 + n_4*4 == n:
            print("Yes")
            end = 1
            break
        n_7 += 1
    if end == 1: break
    n_4+=1
if end == 0:
    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())

ans = 'No'

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

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

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

print("No")

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

flag = False
for i in range(0,30):
  for j in range(0,30):
    if i * 4 + j * 7 == N:
      flag = True

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

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

flag = False
for i in range(0,30):
  for j in range(0,30):
    if i * 4 + j * 7 == N:
      flag = True

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

Solution (Python):
N = int(input())
if N >= 18 or 14 <= N <= 16 or N == 12 or N == 11 or N ==8 or N == 7 or N ==4:
  print('Yes')
  exit()
else:
  print('No')

Solution (Python):
N = int(input())
if N >= 18:
  print('Yes')
  exit()
elif 14 <= N <= 16 or N == 12 or N == 11 or N ==8 or N == 7 or N ==4:
  print('Yes')
  exit()
else:
  print('No')

Solution (Python):
def calc(a):
  for a4 in range(26):
    for a7 in range(16):
      if a4*4+a7*7 == a:
        return "Yes"
  return "No"

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

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

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

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

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

Solution (Python):
import math
y = int(input().split()[0])
for i in range(int(y / 4) + 1):
    x = y - (4 * i)
    if x % 7:
        continue
    else:
        print("Yes")
        exit()
print("No")

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

flg = False
for i in range(100//4 + 1):
    for j in range(100//7 + 1):
        if i * 4 + j * 7 == n:
            print("Yes")
            exit(0)

print("No")

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

for i in range(n//4+1):
    for j in range(n//7+1):
        if n == 4*i+7*j:
            print('Yes')
            exit(0)
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):
import sys


n = int(input())
while n > 0:
    if n % 7 == 0:
        print('Yes')
        sys.exit()
    n -= 4
if n == 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 n == 4*i+7*j:
            print('Yes')
            exit(0)
print('No')

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

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


if __name__ == "__main__":
    main()

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

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

if N%4 == 0:
    print("Yes")
elif N%7 == 0:
    print("Yes")
else:
    for i in range(1,30):
        for j in range(1,30):
            temp = j*7 +i*4
            if temp == N:
                print("Yes")
                sys.exit()

    print("No")

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

Solution (Python):

n=int(input())
ans=0
flag=False
    
for i in range(25):
    for j in range(14):
        ans=4*i+j*7
        if ans==n:
            flag=True
            break
        elif ans>n:
            break
print('Yes' if flag==True else '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())
 
isExist = False

for i in range(int(n / 7) + 1):
  for j in range(int(n / 4) + 1):
    if (7 * i + 4 * j == n):
      isExist = True
      break

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

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

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

Solution (Python):
n=int(input())
ans='No'
for i in range(15):
    a=n-i*7
    if a>=0 and a%4==0:ans='Yes'
print(ans)

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

judge = False

for i in range(0,26):
    for j in range(0,16):
        if 4*i + 7*j == n:
            judge = True

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

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

cake = 4
donatu = 7
ans = False

for i in range(100):
  for j in range(100):
    if cake*i + donatu*j == N:
      ans = True
      break
  if ans:
    break

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

Solution (Python):

N = int(input())

for i in range(N // 4 + 2):
    for j in range(N // 7 + 2):
        if 4 * i + 7 * j == N:
            print('Yes')
            exit()

print('No')

Solution (Python):
cake = []
donut = []
for i in range(1, 26):
	cake.append(i*4)
for i in range(1, 15):
	donut.append(i*7)

n = int(raw_input())

flag = False
if n in cake: flag = True
if n in donut: flag = True
if not flag:
	for i in range(0, len(cake)):
		for j in range(0, len(donut)):
			if n == cake[i] + donut[j]:
				flag = True
				break
		if flag: break

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

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

rs=0
for i in range(14):
    if (t-7*i)%4==0 and t-7*i>0:
        rs +=1
    else:
        rs +=0
if rs>0 or t%7==0:
    print("Yes")
else:
    print("No")

Solution (Python):


n = int(input())
k = 0
d = 0
while k*7 <= n:
    if (n-k*7) % 4 == 0:
        print("Yes")
        exit()
    else:
        k += 1
print("No")

Solution (Python):


CAKE_DOLLAR = 4
DONUT_DOLLAR = 7

n = int(input())

cake_max = n // CAKE_DOLLAR
donut_max = n // DONUT_DOLLAR

for cake_amount in range(cake_max+1):
    for donut_amount in range(donut_max+1):
        if CAKE_DOLLAR * cake_amount + DONUT_DOLLAR * donut_amount == n:
            print("Yes")
            exit()

print("No")

Solution (Python):


def getList():
    tmpList = []
    for i in range(N):
        for j in range(N):
            tmpList.append(4*i+7*j)
    return tmpList

def solve(N):
    tmpList = getList()
    
    if N in tmpList:
        return "Yes"
    else:
        return "No"
    
if __name__ == "__main__":
    N = int(input())
    print(solve(N))

Solution (Python):
def main():
    n = int(raw_input().strip())
    y = 0
    while 7 * y <= n:
        if (n - 7 * y) % 4 == 0:
            print 'Yes'
            return
        y += 1
    print 'No'

if __name__ == '__main__':
    main()

Solution (Python):
n =int(raw_input())
lis=[]
for i in range(1,26):
    lis.append(4*i)
for i in range(1,15):
    lis.append(7*i)
for i in range(1,20):
    for j in range(1,20):
        lis.append(4*i+7*j)
if n in lis:
    print "Yes"
else:
    print "No"

Solution (Python):

n=int(input())
x = n//4
if n%4==0 or n%7==0:
    print('Yes')
    exit()
else:
    for i in range(x):
        for j in range(x):
            temp=4*i+7*j
            if temp==n:
                print('Yes')
                exit()
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
            break
    if flg:
        break
print('Yes' if flg else 'No')

Solution (Python):
N = int(input())
flag = False
for i in range(26):
  for j in range(16):
    tmp = 4*i + 7*j
    if N == tmp:
      flag = True

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

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

Solution (Python):
N = int(input())
if N%4 == 0 or N%7 ==0:
    print("Yes")
else:
    while N >= 7:
        N = N - 4
        if N%7 ==0:
            print("Yes")
            break
            
if N%7!=0 and N%4!=0:
    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())
"""
 N=list(map(int,input().split()))
 N.sort();
 for i in N:
    print(i)
"""
for i in range(100):
    if n-i*7>=0 and (n-i*7)%4==0 : 
        print('Yes') 
        break
    if n-i*7< 0:
       print('No')
       break

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

s = 0

while(s <= N):
    if((N - s) % 4 == 0):
        print("Yes")
        sw = 1
        sys.exit()
    s += 7


print("No")

Solution (Python):
N=input()
N=int(N)
if N<=3 :
    print('No')
elif N%4 == 0:
    print('Yes')
elif N%7==0 :
    print('Yes')
elif (N-7)%4==0 and N-7>=0:
    print('Yes')
elif (N-14)%4==0 and N-14>=0:
    print('Yes')
elif (N-21)%4==0 and N-21>=0:
    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')
    break
else:
  print('No')

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

Solution (Python):
from itertools import product


n = int(input())

for a, b in product(range(n//4+1), range(n//7+1)):
    if a*4 + b*7 == n:
        print('Yes')
        exit()
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):
from itertools import product


n = int(input())

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

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

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

Solution (Python):


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

Solution (Python):

import logging
import time


class Solver:
    def __init__(self):
        self.n = 0

    
    def input_value(self):
        
        
        
        
        
        self.n = int(input())

    @staticmethod
    def can_buy(n):
        
        for i in range(26):
            for j in range(16):
                if 4 * i + 7 * j == n:
                    return 'Yes'
        return 'No'

        

    
    
    
    

    
    def test(self):
        start_time = time.time()

        assert self.can_buy(11), 'Yes'
        assert self.can_buy(40), 'Yes'
        assert self.can_buy(3), 'No'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()

    

    solver.input_value()
    ans = solver.can_buy(solver.n)
    
    print(ans)

Solution (Python):
N=int(input())
costC=4
costD=7
Flag=False
for i in range(0,100):
    if Flag:
        break

    for j in range(0,100):
     
        costSum=i*costC+j*costD
        if N==costSum:
            Flag=True

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

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

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())
ymax=n//7
for y in range(0,ymax+1):
    if (n-7*y)%4 == 0:
        print('Yes')
        exit()

print('No')

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

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

table = [False for i in range(n+1)]
if n >= 4:
    table[4] = True
if n >= 7:
    table[7] = True
for i in range(8,n+1):
    if table[i-4] == True:
        table[i] = True
    if table[i-7] == True:
        table[i] = True
if table[n]:
    print('Yes')
else:
    print('No')

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

ans()

Solution (Python):
def judge(N):
    i=int(N/7)
    while i>=0:
        if (N-7*i)%4==0:
            return True
        else:
            i-=1
    return False


N=int(input())

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

Solution (Python):
import math
n=int(input())
for a in range(math.floor(n/4)+1):
    if (n-a*4)%7==0:
        print("Yes")
        quit()
print("No")

Solution (Python):
n = int(input())
if n < 4:
    print('No')
else:
    m = n % 4
    if m == 0 or n >= (4 - m) * 7:
        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 = int(input())
result = False
for a in range(25):
    for b in range(14):
        if 4 * a + 7 *b == N:
            result = True
print("Yes" if result else "No")

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

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