Problem: After a revolution in Berland the new dictator faced an unexpected challenge: the country has to be somehow ruled. The dictator is a very efficient manager, yet he can't personally give orders to each and every citizen. That's why he decided to pick some set of leaders he would control. Those leaders will directly order the citizens. However, leadership efficiency turned out to vary from person to person (i.e. while person A makes an efficient leader, person B may not be that good at it). That's why the dictator asked world-famous berland scientists for help. The scientists suggested an innovatory technology — to make the leaders work in pairs.

A relationship graph is some undirected graph whose vertices correspond to people. A simple path is a path with no repeated vertices. Long and frighteningly expensive research showed that a pair of people has maximum leadership qualities if a graph of relationships has a simple path between them with an odd number of edges. The scientists decided to call such pairs of different people leader pairs. Secret services provided the scientists with the relationship graph so that the task is simple — we have to learn to tell the dictator whether the given pairs are leader pairs or not. Help the scientists cope with the task.

Input

The first line contains integers n and m (1 ≤ n ≤ 105, 0 ≤ m ≤ 105) — the number of vertices and edges in the relationship graph correspondingly. Next m lines contain pairs of integers a and b which mean that there is an edge between the a-th and the b-th vertices (the vertices are numbered starting from 1, 1 ≤ a, b ≤ n). It is guaranteed that the graph has no loops or multiple edges.

Next line contains number q (1 ≤ q ≤ 105) — the number of pairs the scientists are interested in. Next q lines contain these pairs (in the same format as the edges, the queries can be repeated, a query can contain a pair of the identical vertices).

Output

For each query print on a single line "Yes" if there's a simple odd path between the pair of people; otherwise, print "No".

Examples

Input

7 7
1 3
1 4
2 3
2 4
5 6
6 7
7 5
8
1 2
1 3
1 4
2 4
1 5
5 6
5 7
6 7


Output

No
Yes
Yes
Yes
No
Yes
Yes
Yes

Note

Notes to the samples:

1) Between vertices 1 and 2 there are 2 different simple paths in total: 1-3-2 and 1-4-2. Both of them consist of an even number of edges. 

2) Vertices 1 and 3 are connected by an edge, that's why a simple odd path for them is 1-3.

5) Vertices 1 and 5 are located in different connected components, there's no path between them.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct graph {
  struct point {
    int next, to;
  } ar[200050];
  int head[200050], art = 1;
  inline void link(int u, int v) {
    ar[++art] = {head[u], v}, head[u] = art;
    ar[++art] = {head[v], u}, head[v] = art;
  }
  inline void link1(int u, int v) { ar[++art] = {head[u], v}, head[u] = art; }
} G, G1, G2;
bool is[200050];
int dfn[200050], low[200050], tim, a2[200050], sta[200050], top, a[200050],
    a1[200050], rt[200050], a3[200050], dep[200050], dp[200050][17], a4[200050];
inline bool dfs(int, int);
inline int lca(int, int);
inline void read(int&), tarjan(int), prepare(), Min(int&, int), dfs1(int),
    dfs2(int);
int main() {
  int n, m;
  read(n), read(m), prepare();
  for (int i(1), u, v; i <= m; ++i) read(u), read(v), G.link(u, v);
  for (int i(1); i <= n; ++i)
    if (!rt[i]) rt[i] = i, dfs1(i);
  for (int i(1); i <= n; ++i)
    if (!dfn[i]) top = 0, tarjan(i);
  tim = 0;
  for (int i(1); i <= n; ++i)
    if (rt[i] == i) dfs2(i);
  for (int i, j(1); j < 17; ++j)
    for (i = 1; i + (1 << j) - 1 <= tim; ++i)
      dp[i][j] = dep[dp[i][j - 1]] < dep[dp[i + (1 << j - 1)][j - 1]]
                     ? dp[i][j - 1]
                     : dp[i + (1 << j - 1)][j - 1];
  int Q;
  read(Q);
  for (int i(1), u, v; i <= Q; ++i)
    if (read(u), read(v), rt[u] ^ rt[v])
      puts("No");
    else if (dep[u] & 1 ^ dep[v] & 1)
      puts("Yes");
    else
      puts(a3[u] + a3[v] - (a3[lca(u, v)] << 1) ? "Yes" : "No");
  return 0;
}
inline int lca(int x, int y) {
  x = a[x], y = a[y];
  if (x > y) x ^= y ^= x ^= y;
  int len(a4[y - x + 1]);
  return dep[dp[x][len]] < dep[dp[y - (1 << len) + 1][len]]
             ? dp[x][len]
             : dp[y - (1 << len) + 1][len];
}
inline void prepare() {
  for (int i(0); 1 << i < 200050; ++i) a4[1 << i] = i;
  for (int i(1); i < 200050; ++i) a4[i] = a4[i] ? a4[i] : a4[i - 1];
}
inline void dfs2(int x) {
  dp[a[x] = ++tim][0] = x;
  for (int i(G2.head[x]), i1; i; i = G2.ar[i].next)
    a3[i1 = G2.ar[i].to] += a3[dp[++tim][0] = x], dfs2(i1);
}
inline void dfs1(int x) {
  for (int i(G.head[x]), i1; i; i = G.ar[i].next)
    if (!rt[i1 = G.ar[i].to])
      G2.link1(x, i1), dep[i1] = dep[x] + 1, a2[i] = a2[i ^ 1] = i1,
                       rt[i1] = rt[x], dfs1(i1);
}
inline bool dfs(int x, int c) {
  a1[x] = c;
  for (int i(G1.head[x]), i1; i; i = G1.ar[i].next)
    if (!~a1[i1 = G1.ar[i].to] && dfs(i1, c ^ 1))
      return true;
    else if (a1[i1] == c)
      return true;
  return false;
}
inline void Min(int& x, int y) { x = x < y ? x : y; }
inline void tarjan(int x) {
  dfn[x] = low[x] = ++tim, sta[++top] = x;
  for (int i(G.head[x]), j, k, i1, i2; i; i = G.ar[i].next)
    if (!dfn[i1 = G.ar[i].to]) {
      tarjan(i1), Min(low[x], low[i1]);
      if (dfn[x] <= low[i1]) {
        int at(0);
        G1.art = 1;
        do G1.head[a[++at] = sta[top]] = 0, is[a[at]] = 1;
        while (sta[top--] ^ i1);
        G1.head[x] = 0, is[x] = 1;
        for (j = 1; j <= at; ++j)
          for (k = G.head[a[j]]; k; k = G.ar[k].next)
            if (is[i2 = G.ar[k].to]) {
              if (i2 == x)
                G1.link(x, a[j]);
              else if (i2 < a[j])
                G1.link(i2, a[j]);
            }
        for (j = 1; j <= at; ++j) a1[a[j]] = -1;
        a1[x] = -1;
        if (dfs(a[1], 0))
          for (j = 1; j <= at; ++j)
            for (k = G.head[a[j]]; k; k = G.ar[k].next)
              if (is[G.ar[k].to] && a2[k]) ++a3[a2[k]], a2[k] = a2[k ^ 1] = 0;
        for (j = 1; j <= at; ++j) is[a[j]] = 0;
        is[x] = 0;
      }
    } else
      Min(low[x], dfn[i1]);
}
inline void read(int& x) {
  x ^= x;
  register char c;
  while (c = getchar(), c < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
}