public boolean helper(TreeNode left, TreeNode right)
    {
        if(left == null && right == null) // both of them null
        {
            return true;
        }
        if((left == null && right != null)||(left!= null && right == null)) // one of them is null
        {
            return false;
        }

        if(left.val == right.val)
        {
            return (helper(left.right, right.left) && helper(left.left, right.right));
        }
        else
        {
            return false;
        }
    }