Limak is a little bear who learns to draw. People usually start with houses, fences and flowers but why would bears do it? Limak lives in the forest and he decides to draw a tree. Recall that tree is a connected graph consisting of n vertices and n - 1 edges. Limak chose a tree with n vertices. He has infinite strip of paper with two parallel rows of dots. Little bear wants to assign vertices of a tree to some n distinct dots on a paper so that edges would intersect only at their endpoints — drawn tree must be planar. Below you can see one of correct drawings for the first sample test. Is it possible for Limak to draw chosen tree?
输入描述:
The first line contains single integer n (1 ≤ n ≤ 105).Next n - 1 lines contain description of a tree. i-th of them contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi) denoting an edge between vertices ai and bi. It's guaranteed that given description forms a tree.


输出描述:
Print "Yes" (without the quotes) if Limak can draw chosen tree. Otherwise, print "No" (without the quotes).
示例1

输入

8<br />1 2<br />1 3<br />1 6<br />6 4<br />6 7<br />6 5<br />7 8<br />13<br />1 2<br />1 3<br />1 4<br />2 5<br />2 6<br />2 7<br />3 8<br />3 9<br />3 10<br />4 11<br />4 12<br />4 13<br />

输出

Yes<br />No<br />
加载中...