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
  
  
  def solve():
      input = lambda: sys.stdin.readline().rstrip()
      sys.setrecursionlimit(10**7)
      mod = 10**9 + 7
  
      def comb(n, r):
          if r > n:
              return 0
          return fac[n] * inv[r] * inv[n - r] % mod
  
      def dfs(v, Pa=-1):
          for u in to[v]:
              if u == Pa:
                  continue
              dfs(u, v)
              size[v] += size[u]
              dp[v] *= dp[u] % mod
              dp[v] *= comb(size[v], size[u]) % mod
          size[v] += 1
  
      def bfs(v, Pa=-1, P_val=1, P_sz=0):
          ans[v] = P_val * dp[v] * comb(n - 1, P_sz) % mod
          for u in to[v]:
              if u == Pa:
                  continue
              val = ans[v] * INV(dp[u] * comb(n - 1, size[u])) % mod
              bfs(u, v, val, n - size[u])
  
      n = int(input())
      to = [[] for _ in range(n)]
      for _ in range(n - 1):
          a, b = map(lambda x: int(x) - 1, input().split())
          to[a].append(b)
          to[b].append(a)
  
      fac = [1] * (n + 2)
      inv = [1] * (n + 2)
  
      for i in range(2, n + 1):
          fac[i] = fac[i - 1] * i % mod
      INV = lambda x: pow(x, mod - 2, mod)
      inv[n] = INV(fac[n])
      for i in range(n - 1, 1, -1):
          inv[i] = inv[i + 1] * (i + 1) % mod
  
      dp = [1] * n
      size = [0] * n
      ans = [0] * n
  
      dfs(0)
      bfs(0)
      print(*ans, sep="\n")
  
  
  if __name__ == "__main__":
      solve()
  
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"}]