{"raw_statement":[{"iden":"problem statement","content":"You are given a connected simple undirected graph $G$ with $N$ vertices numbered $1$ to $N$ and $N$ edges. The $i$\\-th edge connects Vertex $u_i$ and Vertex $v_i$ bidirectionally.\nAnswer the following $Q$ queries.\n\n*   Determine whether there is a unique simple path from Vertex $x_i$ to Vertex $y_i$ (a simple path is a path without repetition of vertices)."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq u_i < v_i\\leq N$\n*   $(u_i,v_i) \\neq (u_j,v_j)$ if $i \\neq j$.\n*   $G$ is a connected simple undirected graph with $N$ vertices and $N$ edges.\n*   $1 \\leq Q \\leq 2 \\times 10^5$\n*   $1 \\leq x_i < y_i\\leq N$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$u_1$ $v_1$\n$u_2$ $v_2$\n$\\vdots$\n$u_N$ $v_N$\n$Q$\n$x_1$ $y_1$\n$x_2$ $y_2$\n$\\vdots$\n$x_Q$ $y_Q$"},{"iden":"sample input 1","content":"5\n1 2\n2 3\n1 3\n1 4\n2 5\n3\n1 2\n1 4\n1 5"},{"iden":"sample output 1","content":"No\nYes\nNo\n\nThe simple paths from Vertex $1$ to $2$ are $(1,2)$ and $(1,3,2)$, which are not unique, so the answer to the first query is `No`.\nThe simple path from Vertex $1$ to $4$ is $(1,4)$, which is unique, so the answer to the second query is `Yes`.\nThe simple paths from Vertex $1$ to $5$ are $(1,2,5)$ and $(1,3,2,5)$, which are not unique, so the answer to the third query is `No`."},{"iden":"sample input 2","content":"10\n3 5\n5 7\n4 8\n2 9\n1 2\n7 9\n1 6\n4 10\n2 5\n2 10\n10\n1 8\n6 9\n8 10\n6 8\n3 10\n3 9\n1 10\n5 8\n1 10\n7 8"},{"iden":"sample output 2","content":"Yes\nNo\nYes\nYes\nNo\nNo\nYes\nNo\nYes\nNo"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}