input: 
  def isSubTree(T: Node, S: Node) -> bool:
      """ Check if the binary tree S is a subtree of the binary tree T.
      >>> T1 = Node(1)
      >>> T1.left = Node(2)
      >>> T1.right = Node(3)
      >>> T2 = Node(2)
      >>> isSubTree(T1, T2)
      True
      >>> T3 = Node(4)
      >>> isSubTree(T1, T3)
      False
      """
  
output:     if not S:
          return True
      if not T:
          return False
      if isIdentical(T, S):
          return True
      return isSubTree(T.left, S) or isSubTree(T.right, S)
  
  def isIdentical(root1: Node, root2: Node) -> bool:
      if not root1 and not root2:
          return True
      if not root1 or not root2:
          return False
      return (root1.val == root2.val and 
              isIdentical(root1.left, root2.left) and 
              isIdentical(root1.right, root2.right))