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;
inline char gc() {
  static char now[1 << 16], *S, *T;
  if (S == T) {
    T = (S = now) + fread(now, 1, 1 << 16, stdin);
    if (S == T) return EOF;
  }
  return *S++;
}
inline int read() {
  int x = 0, f = 1;
  char c = gc();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = gc();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - 48;
    c = gc();
  }
  return x * f;
}
int n, m, q;
namespace tree {
struct adj {
  int to, nxt;
} e[100010 << 1];
int hd[100010], cnt = 1, dep[100010], f[100010][17], val[100010];
inline void ins(int x, int y) {
  e[++cnt] = (adj){y, hd[x]};
  hd[x] = cnt;
}
void dfs(int x) {
  for (int i = 1; i <= 16; ++i) f[x][i] = f[f[x][i - 1]][i - 1];
  for (int i = hd[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (dep[y]) continue;
    dep[y] = dep[x] + 1;
    f[y][0] = x;
    dfs(y);
  }
}
inline int getlca(int x, int y) {
  if (dep[x] < dep[y]) {
    swap(x, y);
  }
  for (int i = 16; i >= 0; --i) {
    if (dep[f[x][i]] >= dep[y]) {
      x = f[x][i];
    }
  }
  if (x == y) return x;
  for (int i = 16; i >= 0; --i) {
    if (f[x][i] != f[y][i]) {
      x = f[x][i];
      y = f[y][i];
    }
  }
  return f[x][0];
}
bool vis[100010];
void DFS(int x) {
  vis[x] = 1;
  for (int i = hd[x]; i; i = e[i].nxt) {
    if (e[i].to == f[x][0]) continue;
    val[e[i].to] += val[x];
    DFS(e[i].to);
  }
}
inline void gao() {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) DFS(i);
  }
}
}  // namespace tree
struct adj {
  int to, nxt, flag;
} e[100010 << 1];
int hd[100010], cnt = 1;
inline void addedge(int x, int y) {
  e[++cnt] = (adj){y, hd[x], 0};
  hd[x] = cnt;
}
int Fa[100010];
int getfa(int x) { return (Fa[x] == x) ? x : (Fa[x] = getfa(Fa[x])); }
int fa_gen[100010];
int getfa_gen(int x) {
  return (fa_gen[x] == x) ? x : (fa_gen[x] = getfa_gen(fa_gen[x]));
}
inline void gen_tree() {
  for (int i = 1; i <= n; ++i) fa_gen[i] = i;
  for (int i = 2; i <= cnt; i += 2) {
    int x = e[i ^ 1].to, y = e[i].to;
    if (getfa_gen(x) != getfa_gen(y)) {
      fa_gen[getfa_gen(x)] = getfa_gen(y);
      e[i].flag = e[i ^ 1].flag = 1;
      tree::ins(x, y);
      tree::ins(y, x);
    }
  }
  for (int i = 1; i <= n; ++i)
    if (!(tree::dep[i])) tree::dep[i] = 1, tree::dfs(i);
}
int cor[100010];
namespace dcc {
int dfn[100010], low[100010], tim = 0, ok[100010 << 1];
stack<int> sta, temp;
bool dfs(int x) {
  for (int i = hd[x]; i; i = e[i].nxt) {
    if (!ok[i]) continue;
    int y = e[i].to;
    if (cor[y] == (cor[x] ^ 1)) continue;
    if (cor[y] == cor[x]) return 0;
    cor[y] = (cor[x] ^ 1);
    if (!dfs(y)) return 0;
  }
  return 1;
}
void tarjan(int x, int f) {
  dfn[x] = low[x] = ++tim;
  for (int i = hd[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == f) continue;
    if (!dfn[y]) {
      sta.push(i);
      tarjan(y, x);
      low[x] = min(low[x], low[y]);
      if (low[y] >= dfn[x]) {
        while (true) {
          int edg = sta.top();
          sta.pop();
          ok[edg] = ok[edg ^ 1] = 1;
          cor[e[edg ^ 1].to] = cor[e[edg].to] = -1;
          temp.push(edg);
          if (e[edg ^ 1].to == x && e[edg].to == y) break;
        }
        cor[x] = 0;
        bool flag = dfs(x);
        while (!temp.empty()) {
          int edg = temp.top();
          temp.pop();
          int v = e[edg].to, u = e[edg ^ 1].to;
          if (tree::dep[u] < tree::dep[v]) swap(u, v);
          if (e[edg].flag && !flag) {
            tree::val[u] = 1;
          }
          ok[edg] = ok[edg ^ 1] = 0;
        }
      }
    } else if (dfn[y] < dfn[x])
      sta.push(i), low[x] = min(low[x], dfn[y]);
  }
}
inline void init() {
  for (int i = 1; i <= n; ++i) tarjan(i, 0);
}
}  // namespace dcc
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; ++i) Fa[i] = i;
  for (int i = 1; i <= m; ++i) {
    int x = read(), y = read();
    addedge(x, y);
    addedge(y, x);
    Fa[getfa(x)] = getfa(y);
  }
  gen_tree();
  dcc::init();
  tree::gao();
  q = read();
  while (q--) {
    int x = read(), y = read();
    if (getfa(x) != getfa(y)) {
      puts("No");
      continue;
    }
    int lca = tree::getlca(x, y);
    if ((tree::dep[x] + tree::dep[y] - 2 * tree::dep[lca]) & 1)
      puts("Yes");
    else {
      if (tree::val[x] + tree::val[y] - 2 * tree::val[lca] > 0)
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}