output_description: If there is a way to buy some cakes and some doughnuts for exactly N dollars,
  print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import sys, os, math, bisect, itertools, collections, heapq, queue
  
  # from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
  from decimal import Decimal
  from collections import defaultdict, deque
  
  sys.setrecursionlimit(10000000)
  
  ii = lambda: int(sys.stdin.buffer.readline().rstrip())
  il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
  fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
  iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]
  
  iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
  sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
  isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]
  
  lcm = lambda x, y: (x * y) // math.gcd(x, y)
  
  MOD = 10**9 + 7
  MAX = float("inf")
  
  
  def main():
      if os.getenv("LOCAL"):
          sys.stdin = open("input.txt", "r")
  
      N = ii()
      A = N // 4 + 1
      B = N // 7 + 1
  
      for a in range(A):
          for b in range(B):
              if a * 4 + b * 7 == N:
                  print("Yes")
                  exit()
      else:
          print("No")
  
  
  if __name__ == "__main__":
      main()
  
problem_description: 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.
samples: [{"input": "11", "output": "Yes\n    \n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\n* * *"}, {"input": "40", "output": "Yes\n    \n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\n* * *"}, {"input": "3", "output": "No\n    \n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than\n3 dollars, so there is no such way."}]