{"raw_statement":[{"iden":"problem statement","content":"You are given a tree with $N$ vertices, where $N$ is **odd**. The vertices are numbered from $1$ through $N$ and edges from $1$ through $N-1$. The edge $i$ connects vertices $u_i$ and $v_i$ and its initial weight is $w^1_i$.\nYou can perform the following operation any number of times:\n\n*   Choose an edge $(u, v)$ of the tree, and suppose that its weight now is $w$. For every edge, which is incident to exactly one of $u$ and $v$, we **XOR** the weight of that edge with $w$ (if it was $w_1$, replace it with $w_1 \\oplus w$).\n\nYour goal is to reach the state where each edge $i$ has weight $w^2_i$. Determine if you can get to the goal by performing the operation above any number of times."},{"iden":"constraints","content":"*   $1 \\le N \\le 10^5$\n*   $N$ is odd.\n*   $1\\le u_i, v_i \\le N$\n*   $u_i \\neq v_i$\n*   $0\\le w^1_i, w^2_i < 2^{30}$\n*   All values in input are integers.\n*   The input represents a valid tree."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$u_1$ $v_1$ $w^1_1$ $w^2_1$\n$u_2$ $v_2$ $w^1_2$ $w^2_2$\n$\\vdots$\n$u_{N-1}$ $v_{N-1}$ $w^1_{N-1}$ $w^2_{N-1}$"},{"iden":"sample input 1","content":"3\n1 2 1 1\n2 3 8 9"},{"iden":"sample output 1","content":"YES\n\nIf you perform the operation on the edge $1$, the weight of the edge $2$ becomes $8 \\oplus 1=9$."},{"iden":"sample input 2","content":"5\n1 2 0 3\n1 3 1 0\n1 4 2 1\n1 5 0 0"},{"iden":"sample output 2","content":"NO"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}