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 MAX = 200010;
vector<int> L[MAX];
struct data {
  int a, b, ans, done;
} Q[MAX];
int ara[MAX];
namespace BCT {
vector<int> ed[MAX];
bool cut[MAX];
int tot, Time, low[MAX], st[MAX];
vector<int> bcc[MAX];
stack<int> S;
void popBCC(int s, int x) {
  cut[s] = 1;
  bcc[++tot].push_back(s);
  while (bcc[tot].back() ^ x) {
    bcc[tot].push_back(S.top());
    S.pop();
  }
}
void dfs(int s, int p = -1) {
  S.push(s);
  int ch = 0;
  st[s] = low[s] = ++Time;
  for (int x : ed[s]) {
    if (!st[x]) {
      ch++;
      dfs(x, s);
      low[s] = min(low[s], low[x]);
      if (p != -1 && low[x] >= st[s])
        popBCC(s, x);
      else if (p == -1)
        if (ch > 1) popBCC(s, x);
    } else if (p != x)
      low[s] = min(low[s], st[x]);
  }
  if (p == -1 && ch > 1) cut[s] = 1;
}
void processBCC(int n) {
  for (int i = 1; i <= n; i++) bcc[i].clear();
  memset(st, 0, sizeof(st));
  memset(cut, 0, sizeof(cut));
  Time = tot = 0;
  for (int i = 1; i <= n; i++) {
    if (!st[i]) {
      dfs(i, -1);
      if (!S.empty()) ++tot;
      while (!S.empty()) {
        bcc[tot].push_back(S.top());
        S.pop();
      }
    }
  }
}
int nn;
vector<int> tree[MAX];
int compNum[MAX];
bool oc;
int dis[MAX];
void ogo(int s, int p, int id) {
  for (int x : BCT::ed[s]) {
    if (compNum[x] != id) continue;
    if (x == p or x == s) continue;
    if (dis[x]) {
      if (dis[x] % 2 == dis[s] % 2) oc = true;
    } else {
      dis[x] = dis[s] + 1;
      ogo(x, s, id);
    }
  }
}
void buildTree(int n) {
  processBCC(n);
  for (int i = 1; i <= tot; i++) {
    for (int v : bcc[i]) {
      compNum[v] = i;
      dis[v] = 0;
    }
    oc = false;
    dis[bcc[i][0]] = 1;
    ogo(bcc[i][0], bcc[i][0], i);
    ara[i] = oc;
    for (int q : bcc[i]) {
      for (int r : L[q]) {
        if (Q[r].done) continue;
        int a = Q[r].a;
        int b = Q[r].b;
        if (compNum[a] == compNum[b]) {
          Q[r].done = true;
          if (ara[i])
            Q[r].ans = true;
          else if ((dis[a] % 2) != (dis[b] % 2)) {
            Q[r].ans = true;
          } else
            Q[r].ans = false;
        }
      }
    }
    for (int v : bcc[i]) {
      compNum[v] = i;
      dis[v] = 0;
    }
  }
  nn = tot;
  for (int i = 1; i <= n; i++)
    if (cut[i]) compNum[i] = ++nn;
  for (int i = 1; i <= tot; i++) {
    for (int v : bcc[i]) {
      if (cut[v]) {
        tree[i].push_back(compNum[v]);
        tree[compNum[v]].push_back(i);
      } else {
        compNum[v] = i;
      }
    }
  }
}
};  // namespace BCT
namespace HLD {
int ptr, par[MAX];
int sz[MAX], h[MAX], pos[MAX], head[MAX], base[MAX];
struct SegmentTree {
  struct node {
    int mn;
  } tree[4 * MAX];
  node Merge(node a, node b) {
    node ret;
    ret.mn = a.mn + b.mn;
    return ret;
  }
  void build(int n, int st, int ed) {
    if (st == ed) {
      tree[n].mn = ara[base[st]];
      return;
    }
    int mid = (st + ed) / 2;
    build(2 * n, st, mid);
    build(2 * n + 1, mid + 1, ed);
    tree[n] = Merge(tree[2 * n], tree[2 * n + 1]);
  }
  node query(int n, int st, int ed, int i, int j) {
    if (st >= i && ed <= j) return tree[n];
    int mid = (st + ed) / 2;
    if (mid < i)
      return query(2 * n + 1, mid + 1, ed, i, j);
    else if (mid >= j)
      return query(2 * n, st, mid, i, j);
    else
      return Merge(query(2 * n, st, mid, i, j),
                   query(2 * n + 1, mid + 1, ed, i, j));
  }
} st;
void dfs(int u, int far) {
  sz[u] = 1, h[u] = far;
  for (int v : BCT::tree[u])
    BCT::tree[v].erase(find(BCT::tree[v].begin(), BCT::tree[v].end(), u));
  for (int &v : BCT::tree[u]) {
    par[v] = u;
    dfs(v, far + 1);
    sz[u] += sz[v];
    if (sz[v] > sz[BCT::tree[u][0]]) swap(v, BCT::tree[u][0]);
  }
}
void hld(int u) {
  pos[u] = ++ptr;
  base[ptr] = u;
  for (int v : BCT::tree[u]) {
    head[v] = (v == BCT::tree[u][0] ? head[u] : v);
    hld(v);
  }
}
inline int query(int n, int u, int v) {
  int res = 0;
  while (head[u] != head[v]) {
    if (h[head[u]] > h[head[v]]) swap(u, v);
    res += st.query(1, 1, n, pos[head[v]], pos[v]).mn;
    v = par[head[v]];
  }
  if (h[u] > h[v]) swap(u, v);
  res += st.query(1, 1, n, pos[u], pos[v]).mn;
  return res;
}
void build(int n, int root, int x) {
  ptr = 0;
  for (int i = 1; i <= n; i++) {
    if (!head[i]) {
      head[i] = i;
      h[i] = 0;
      dfs(i, 0);
      hld(i);
    }
  }
  st.build(1, 1, n);
}
};  // namespace HLD
int D[MAX];
int mark[MAX];
int cur = 0;
void call(int s, int d) {
  mark[s] = cur;
  D[s] = d;
  for (int x : BCT::ed[s]) {
    if (mark[x] == 0) call(x, d + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m, q, a, b;
  cin >> n >> m;
  int x = -1;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    if (x == -1) x = a;
    BCT::ed[a].push_back(b);
    BCT::ed[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (D[i] == 0) {
      cur++;
      call(i, 1);
    }
  }
  cin >> q;
  for (int i = 1; i <= q; i++) {
    cin >> Q[i].a >> Q[i].b;
    Q[i].done = Q[i].ans = 0;
    if (Q[i].b == Q[i].a) {
      Q[i].done = true;
      Q[i].ans = false;
      continue;
    }
    L[Q[i].a].push_back(i);
    L[Q[i].b].push_back(i);
    if (mark[Q[i].a] != mark[Q[i].b]) {
      Q[i].done = true;
      Q[i].ans = false;
    }
  }
  BCT::buildTree(n);
  HLD::build(BCT::nn, 1, n);
  for (int i = 1; i <= q; i++) {
    if (!Q[i].done) {
      if (D[Q[i].a] % 2 != D[Q[i].b] % 2) {
        Q[i].ans = 1;
      } else {
        int x = BCT::compNum[Q[i].a];
        int y = BCT::compNum[Q[i].b];
        Q[i].ans = HLD::query(BCT::nn, x, y);
      }
    }
    if (Q[i].ans)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}