check if tree leaves at the same level