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: import sys
  
  sys.setrecursionlimit(3 * 10**5)
  
  n = int(input())
  edge = [tuple(map(int, input().split())) for _ in range(n - 1)]
  mod = 10**9 + 7
  
  
  def extGCD(a, b):
      if b == 0:
          return a, 1, 0
      g, y, x = extGCD(b, a % b)
      y -= a // b * x
      return g, x, y
  
  
  def moddiv(a, b):
      _, inv, _ = extGCD(b, mod)
      return (a * inv) % mod
  
  
  N = 10**5 + 10
  fact = [0] * (N)
  fact[0] = 1
  for i in range(1, N):
      fact[i] = (fact[i - 1] * i) % mod
  
  
  def comb(a, b):
      return moddiv(moddiv(fact[a], fact[a - b]), fact[b])
  
  
  connect = [set() for _ in range(n)]
  for a, b in edge:
      connect[a - 1].add(b - 1)
      connect[b - 1].add(a - 1)
  
  d = [{} for _ in range(n)]
  
  
  def dfs(v, p):
      if p in d[v]:
          return d[v][p]
      num, count = 0, 1
      for next in connect[v]:
          if next != p:
              i, c = dfs(next, v)
              num += i
              count *= c
              count %= mod
              count *= comb(num, i)
              count %= mod
      num += 1
      d[v][p] = num, count
      return num, count
  
  
  for i in range(n):
      dfs(i, -1)
      print(d[i][-1][1])
  
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"}]