Check in unique BST and parathesis