input: 
  def is_subtree(T, S):
      """ Check if binary tree S is a subtree of binary tree T.
      >>> T = Node(1)
      >>> T.left = Node(2)
      >>> T.right = Node(3)
      >>> T.left.left = Node(4)
      >>> T.left.right = Node(5)
      >>> S = Node(2)
      >>> S.left = Node(4)
      >>> S.right = Node(5)
      >>> is_subtree(T, S)
      True
      >>> S = Node(2)
      >>> S.left = Node(4)
      >>> S.right = Node(6)
      >>> is_subtree(T, S)
      False
      """
  
output:     def is_same_tree(t1, t2):
          if not t1 and not t2:
              return True
          if not t1 or not t2:
              return False
          return t1.val == t2.val and is_same_tree(t1.left, t2.left) and is_same_tree(t1.right, t2.right)
  
      def traverse(t, s):
          if not t:
              return False
          if is_same_tree(t, s):
              return True
          return traverse(t.left, s) or traverse(t.right, s)
  
      return traverse(T, S)