Job or joy#2280

Job or joy

1 secondo
64 megabyte
Molto difficile

How long can you solve problems without a break? Sometimes you want to rest, but now is not the time. You need to gather your thoughts and snatch victory from your rivals.

This problem is intended to distinguish good teams from Champions, those who aim to get into the top ten from those who are not willing to take a place below first. As the number of people who want to find the author of this dense introduction and express their opinions is growing, let's get down to business. An undirected graph is given. Then some queries follow. Each query consists of a pair of vertices.

For each query, determine whether there exist at least three edge-disjoint paths from the first vertex to the second.

Input

The first line contains two integers and (1 \leq n, k \leq 100000) — the number of vertices and edges in the graph. Each of the next lines describes an edge by a pair of connected vertices , (1 \leq a, b \leq n). Edges connect different vertices, and between any two vertices there is at most one edge. The next line contains the number of queries (0 \leq q \leq 100000). Each of the next lines contains two integers , (a \neq b, 1 \leq a, b \leq n) — the pair of vertices for the query.

Output

For each query, output one line: Yes if such three paths exist, or No otherwise.

Esempi

Esempio 1

Loading
Loading