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;
const int maxn = 100005, maxm = 100005;
struct edge {
  int to, next;
} e[maxm * 2];
int h[maxn], tot;
int n, m, q;
struct Edge {
  int u, v;
  bool operator<(const Edge &a) const { return u != a.u ? u < a.u : v < a.v; }
};
stack<Edge> S;
vector<Edge> bcc_e[maxn];
map<Edge, int> odd;
inline void add(int u, int v) {
  e[++tot] = (edge){v, h[u]};
  h[u] = tot;
}
int Time, dfn[maxn], low[maxn], bcc_cnt, bccno[maxn];
vector<int> bcc[maxn];
bool iscut[maxn];
void tarjan(int u, int fa) {
  dfn[u] = low[u] = ++Time;
  int child = 0;
  for (int i = h[u]; i; i = e[i].next) {
    int v = e[i].to;
    Edge E = (Edge){u, v};
    if (!dfn[v]) {
      S.push(E);
      ++child;
      tarjan(v, u);
      low[u] = min(low[u], low[v]);
      if (low[v] >= dfn[u]) {
        iscut[u] = true;
        bcc_cnt++;
        for (;;) {
          Edge x = S.top();
          S.pop();
          bcc_e[bcc_cnt].push_back(x);
          if (bccno[x.u] != bcc_cnt)
            bcc[bcc_cnt].push_back(x.u), bccno[x.u] = bcc_cnt;
          if (bccno[x.v] != bcc_cnt)
            bcc[bcc_cnt].push_back(x.v), bccno[x.v] = bcc_cnt;
          if (x.u == u && x.v == v) break;
        }
      }
    } else if (dfn[v] < dfn[u] && v != fa) {
      S.push(E);
      low[u] = min(low[u], dfn[v]);
    }
  }
  if (fa == 0 && child == 1) iscut[u] = false;
}
void find_bcc() {
  for (int i = 1; i <= n; ++i)
    if (!dfn[i]) tarjan(i, 0);
}
int now, col[maxn];
bool color(int u) {
  for (int i = h[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (bccno[v] != now) continue;
    if (col[v] == col[u]) return false;
    if (!col[v]) {
      col[v] = 3 - col[u];
      if (!color(v)) return false;
    }
  }
  return true;
}
void color_bcc() {
  fill(bccno + 1, bccno + n + 1, 0);
  for (int i = 1; i <= bcc_cnt; ++i) {
    for (int v : bcc[i]) bccno[v] = i;
    int u = bcc[i][0];
    col[u] = 1;
    now = i;
    if (!color(u))
      for (Edge E : bcc_e[i]) odd[E] = true;
    for (int v : bcc[i]) col[v] = 0;
  }
}
int ufs[maxn], U[maxn], V[maxn];
int find(int x) {
  if (ufs[x] == 0) return x;
  return ufs[x] = find(ufs[x]);
}
bool merge(int u, int v) {
  int x = find(u), y = find(v);
  if (x == y) return false;
  ufs[x] = y;
  return true;
}
void build_tree() {
  for (int i = 1, j = 1; i < n; ++i) {
    while (j <= m && !merge(U[j], V[j])) ++j;
    if (j > m) break;
    add(U[j], V[j]);
    add(V[j], U[j]);
  }
}
int logn = 1;
int deep[maxn], f[maxn][20], unv[maxn][20];
int flag[maxn];
void dfs(int u, int fa) {
  flag[u] = now;
  f[u][0] = fa;
  deep[u] = deep[fa] + 1;
  for (int i = h[u], v; i; i = e[i].next) {
    v = e[i].to;
    if (v == fa) continue;
    unv[v][0] = odd.count((Edge){u, v}) | odd.count((Edge){v, u});
    dfs(v, u);
  }
}
void get_fa() {
  for (int &j = logn; (1 << j) <= n; ++j)
    for (int i = 1; i <= n; ++i)
      f[i][j] = f[f[i][j - 1]][j - 1],
      unv[i][j] = unv[i][j - 1] | unv[f[i][j - 1]][j - 1];
}
bool lca(int u, int v) {
  if (deep[u] > deep[v]) swap(u, v);
  int ans = 0, p = deep[v] - deep[u], len = 0;
  for (int i = 0; (1 << i) <= n; ++i)
    if (p & (1 << i)) ans |= unv[v][i], v = f[v][i], len += (1 << i);
  if (u == v) return ans || (len & 1);
  for (int i = logn; i >= 0; --i)
    if (f[u][i] != f[v][i]) {
      ans |= unv[v][i] | unv[u][i];
      u = f[u][i];
      v = f[v][i];
      len += (1 << i) << 1;
    }
  ans |= unv[v][0] | unv[u][0];
  len += 2;
  return ans || (len & 1);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &U[i], &V[i]);
    add(U[i], V[i]);
    add(V[i], U[i]);
  }
  find_bcc();
  color_bcc();
  fill(h + 1, h + n + 1, 0);
  tot = 0;
  build_tree();
  now = 0;
  for (int i = 1; i <= n; ++i)
    if (!flag[i]) ++now, dfs(i, 0);
  get_fa();
  scanf("%d", &q);
  for (int x, y, i = 1; i <= q; ++i) {
    scanf("%d%d", &x, &y);
    if (flag[x] == flag[y] && lca(x, y))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}