input: 
  from typing import Optional, List
  
  class Node:
      def __init__(self, data):
          self.data = data
          self.left = None
          self.right = None
  
  def isSubTree(T: Optional[Node], S: Optional[Node]) -> bool:
      """
      Check if the binary tree S is a subtree of binary tree T.
      
      >>> root1 = Node(1)
      >>> root1.left = Node(2)
      >>> root1.right = Node(3)
      >>> root1.right.left = Node(4)
      >>> root1.right.right = Node(5)
      
      >>> root2 = Node(3)
      >>> root2.left = Node(4)
      >>> root2.right = Node(5)
      
      >>> isSubTree(root1, root2)
      True
      
      >>> root3 = Node(3)
      >>> root3.left = Node(7)
      >>> root3.right = Node(5)
      
      >>> isSubTree(root1, root3)
      False
      """
      
      if S is None:
          return True
      
      if T is None:
          return False
      
      if areIdentical(T, S):
          return True
      
      return isSubTree(T.left, S) or isSubTree(T.right, S)
  
  def areIdentical(T: Optional[Node], S: Optional[Node]) -> bool:
      
      if T is None and S is None:
          return True
      
      if T is None or S is None:
          return False
      
      return (T.data == S.data and areIdentical(T.left, S.left) and areIdentical(T.right, S.right))
  
output:     if T is None and S is None:
          return True
      
      if T is None or S is None:
          return False
      
      return (T.data == S.data and areIdentical(T.left, S.left) and areIdentical(T.right, S.right))