Yandex interview question

Check if a tree is binary.