```
class Solution(object):
def __init__(self):
self.res = []
def findSecondMinimumValue(self, root):
if not root:
return []
if root:
self.res.append(root.val)
self.findSecondMinimumValue(root.left)
self.findSecondMinimumValue(root.right)
return -1 if len(sorted(set(self.res))) == 1 else sorted(set(self.res))[1]
```