check if given BT is valid BST