input: Write a function to compare two binary trees and determine if they are similar. The function should return True if both trees are similar (i.e., they have the same structure and values at corresponding nodes), and False otherwise. If either or both trees are empty, the function should return False.
  class TreeNode:
      def __init__(self, x):
          self.val = x
          self.left = None
          self.right = None
  
  def are_similar(root1, root2):
      if root1 is None and root2 is None:
          return True
      if not root1 or not root2:
          return False
      if root1.val != root2.val:
          return False
      return are_similar(root1.left, root2.left) and are_similar(root1.right, root2.right)
  
  assert are_similar(None, None)==True
  assert are_similar(TreeNode(1), None)==False
  assert are_similar(None, TreeNode(1))==False
  assert are_similar(TreeNode(1), TreeNode(1))==True
  assert are_similar(TreeNode(1), TreeNode(2))==False
  root1 = TreeNode(1)
  root1.left = TreeNode(2)
  root1.right = TreeNode(3)
  root2 = TreeNode(1)
  root2.left = TreeNode(2)
  root2.right = TreeNode(3)
  assert are_similar(root1, root2)==True
  root1.right.val = 4
  assert are_similar(root1, root2)==False
output: 
  def are_similar(root1, root2):
      if root1 is None and root2 is None:
          return True
      if not root1 or not root2:
          return False
      if root1.val != root2.val:
          return False
      return are_similar(root1.left, root2.left) and are_similar(root1.right, root2.right)
  