#abc266f. [abc266_f]Well-defined Path Queries on a Namori
[abc266_f]Well-defined Path Queries on a Namori
Problem Statement
You are given a connected simple undirected graph with vertices numbered to and edges. The -th edge connects Vertex and Vertex bidirectionally.
Answer the following queries.
- Determine whether there is a unique simple path from Vertex to Vertex (a simple path is a path without repetition of vertices).
Constraints
- if .
- is a connected simple undirected graph with vertices and edges.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain Yes
if there is a unique simple path from Vertex to Vertex , and No
otherwise.
Sample Input 1
Sample Output 1
The simple paths from Vertex to are and , which are not unique, so the answer to the first query is No
.
The simple path from Vertex to is , which is unique, so the answer to the second query is Yes
.
The simple paths from Vertex to are and , which are not unique, so the answer to the third query is No
.