output_description: If S is coffee-like, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: k, n = map(int, input().split())
  a = list(map(int, input().split()))
  a.sort()
  
  zero = False
  if 0 in a:
      a.remove(0)
      n = n - 1
      zero = True
      # print("contain 0.")
  
  l1 = a[n - 1] - a[0]  # 0を通らない側
  l2 = a[0] + k - a[n - 1]  # 0を通る側
  if zero == True:
      ret = l2
  else:
      ret = l1 if l1 < l2 else l2
  print("{}".format(ret))
  
problem_description: Statement
  
  A string of length 6 consisting of lowercase English letters is said to be
  coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th
  and 6-th characters are also equal.  
  Given a string S, determine whether it is coffee-like.
samples: [{"input": "sippuu", "output": "Yes\n    \n\nIn `sippuu`, the 3-rd and 4-th characters are equal, and the 5-th and 6-th\ncharacters are also equal.\n\n* * *"}, {"input": "iphone", "output": "No\n    \n\n* * *"}, {"input": "coffee", "output": "Yes"}]