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