input: Write a function that checks if two given binary trees are similar, meaning they have the same structure and the same values at corresponding nodes. The function should return True if the trees are similar, otherwise 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 (root1 is None) != (root2 is None):
          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(5), None)==False
  assert are_similar(None, TreeNode(5))==False
  assert are_similar(TreeNode(5), TreeNode(5))==True
  
  root1 = TreeNode(5)
  root1.left = TreeNode(3)
  root1.right = TreeNode(7)
  root2 = TreeNode(5)
  root2.left = TreeNode(3)
  root2.right = TreeNode(7)
  assert are_similar(root1, root2)==True
  
  root3 = TreeNode(5)
  root3.left = TreeNode(3)
  root4 = TreeNode(5)
  root4.right = TreeNode(3)
  assert are_similar(root3, root4)==False
output: def are_similar(root1, root2):
      if root1 is None and root2 is None:
          return True
      if (root1 is None) != (root2 is None):
          return False
      if root1.val != root2.val:
          return False
      return are_similar(root1.left, root2.left) and are_similar(root1.right, root2.right)