checks if the two node in the tree are cousins or not