public boolean helper(TreeNode t1, TreeNode t2) {
        if (t1 == null && t2 == null) {
            return true;
        } else if (t1 == null)
            return false;
        else if (t2 == null)
            return false;
        if (t1.val != t2.val) {
            return false;
        }
        return helper(t1.left, t2.left) && helper(t1.right, t2.right);

    }