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;
template <bool Rank = true>
struct DsuSec {
  map<int, int> r, sz;
  vector<pair<int, int> > edges;
  void clear() {
    r.clear();
    sz.clear();
    edges.clear();
  }
  int root(int u) const {
    const auto it = r.find(u);
    if (it == r.end()) return u;
    return it->second;
  }
  int size(int u) const {
    const auto it = sz.find(u);
    if (it == sz.end()) return 1;
    return it->second;
  }
  int size() const { return edges.size(); }
  int find(int u) {
    if (u == root(u)) return u;
    return r[u] = find(root(u));
  }
  int join(int u, int v) {
    edges.push_back({u, v});
    u = find(u);
    v = find(v);
    if (u == v) return 0;
    if (Rank && size(u) > size(v)) std::swap(u, v);
    r[u] = v;
    sz[v] = size(u) + size(v);
    return 1;
  }
  void join_bipartite(int u, int v) {
    join(2 * u, 2 * v + 1);
    join(2 * v, 2 * u + 1);
  }
  bool is_bipartite() {
    if (r.empty()) return true;
    int u = r.begin()->first;
    return find(u) != find(u ^ 1);
  }
  void swap(DsuSec& rhs) {
    r.swap(rhs.r);
    sz.swap(rhs.sz);
    edges.swap(rhs.edges);
  }
  void merge(DsuSec& rhs) {
    if (rhs.size() > size()) this->swap(rhs);
    for (pair<int, int> e : rhs.edges) join(e.first, e.second);
  }
};
const int N = 5e5 + 10;
DsuSec<false> dsu;
DsuSec<true> sec[N];
int n, m, nz;
vector<pair<int, int> > queries;
bool in_tree[N], vis[N];
vector<int> adj[N], t[N];
int p[N], L[N], color[N];
void add_edge(int u, int v) {
  adj[u].push_back(v);
  adj[v].push_back(u);
}
void dfs(int u, int pr = -1) {
  p[u] = pr;
  for (int v : adj[u]) {
    if (v == pr) continue;
    L[v] = L[u] + 1;
    dfs(v, u);
  }
}
void dfst(int u, int pr = -1) {
  vis[u] = 1;
  for (int v : t[u]) {
    if (v == pr) continue;
    color[v] = color[u] ^ 1;
    dfst(v, u);
  }
}
bool is_block(int u) { return u >= n; }
int join_block(int u, int p) {
  u = dsu.find(u);
  p = dsu.find(p);
  assert(u != p);
  int res = !sec[u].is_bipartite();
  dsu.join(u, p);
  sec[p].merge(sec[u]);
  return res;
}
const int LOGN = 20;
int tempo;
bool odd[N];
int P[N][LOGN], odds[N][LOGN];
int sta[N], nd[N];
void yandex_dfs(int u, int p = -1) {
  sta[u] = ++tempo;
  P[u][0] = p;
  odds[u][0] = odd[u];
  for (int i = 1; i < LOGN; i++)
    if (P[u][i - 1] != -1)
      P[u][i] = P[P[u][i - 1]][i - 1],
      odds[u][i] = odds[P[u][i - 1]][i - 1] | odds[u][i - 1];
  for (int v : t[u])
    if (!sta[v]) yandex_dfs(v, u);
  nd[u] = tempo;
}
bool anc(int p, int x) { return sta[p] <= sta[x] && sta[x] <= nd[p]; }
int LCA(int u, int v) {
  if (anc(u, v)) return u;
  for (int i = LOGN - 1; i >= 0; i--) {
    if (P[u][i] != -1 && !anc(P[u][i], v)) u = P[u][i];
  }
  if (P[u][0] != -1 && anc(P[u][0], v)) return P[u][0];
  return -1;
}
int lift(int u, int p) {
  if (u == p) return odd[u];
  int res = 0;
  for (int i = LOGN - 1; i >= 0; i--) {
    if (P[u][i] != -1 && !anc(P[u][i], p)) {
      res |= odds[u][i];
      u = P[u][i];
    }
  }
  return res | odds[u][1];
}
void yandex() {
  for (int i = 0; i < nz; i++) t[i].clear();
  for (int i = 0; i < nz; i++) odd[i] = !sec[dsu.find(i)].is_bipartite();
  for (int i = 0; i < nz; i++)
    for (int v : adj[i]) t[dsu.find(i)].push_back(dsu.find(v));
  memset(P, -1, sizeof P);
  for (int i = 0; i < nz; i++) {
    if (!sta[i]) yandex_dfs(i);
  }
  int q;
  cin >> q;
  while (q--) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    int w = LCA(a, b);
    if (w == -1)
      cout << "No"
           << "\n";
    else if (lift(a, w) || lift(b, w) || color[a] != color[b])
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  nz = n;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    if (dsu.join(x, y)) {
      in_tree[i] = true;
      add_edge(x, nz);
      add_edge(nz, y);
      t[x].push_back(y);
      t[y].push_back(x);
      sec[nz].join_bipartite(x, y);
      nz++;
    }
    queries.push_back({x, y});
  }
  memset(p, -1, sizeof p);
  for (int i = 0; i < nz; i++)
    if (p[i] == -1) dfs(i);
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < nz; i++)
    if (!vis[i]) dfst(i);
  dsu.clear();
  for (int i = 0; i < m; i++) {
    if (in_tree[i]) {
      continue;
    }
    int u, v;
    tie(u, v) = queries[i];
    if (u == v) {
      continue;
    }
    int parity = color[u] ^ color[v];
    vector<int> blocks;
    u = dsu.find(u);
    v = dsu.find(v);
    while (u != v) {
      if (L[u] < L[v]) swap(u, v);
      if (is_block(u)) blocks.push_back(u);
      u = dsu.find(p[u]);
    }
    if (is_block(u)) blocks.push_back(u);
    assert(!blocks.empty());
    for (int i = 1; i < (int)blocks.size(); i++)
      if (L[blocks[i]] < L[blocks[0]]) swap(blocks[i], blocks[0]);
    int acc = !sec[blocks[0]].is_bipartite();
    for (int i = 1; i < (int)blocks.size(); i++)
      acc |= join_block(blocks[i], blocks[0]);
    sec[blocks[0]].join_bipartite(queries[i].first, queries[i].second);
    if (acc) {
    } else {
      string res = "00";
      res[parity] = '1';
    }
  }
  yandex();
}