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;
int nodes, edges, counter, counter2;
vector<int> adj[100001];
set<int> adjset[100001];
int seen[100001];
int low[100001];
int depth[100001];
bool iscut[100001];
set<int> group[100001];
int dfn[100001];
stack<pair<int, int> > s;
set<pair<int, int> > ins;
bool isOld[100001];
int father[100001];
void findComponents(int node) {
  if (false) cout << "Happy\n";
  isOld[node] = true;
  counter2++;
  dfn[node] = counter2;
  low[node] = dfn[node];
  while (adjset[node].size()) {
    if (false) cout << "Happier\n";
    int w = *adjset[node].begin();
    adjset[node].erase(w);
    adjset[w].erase(node);
    if (ins.count(make_pair(node, w)) == 0) {
      ins.insert(make_pair(node, w));
      ins.insert(make_pair(w, node));
      s.push(make_pair(node, w));
    }
    if (!isOld[w]) {
      father[w] = node;
      findComponents(w);
      if (low[w] >= dfn[node]) {
        iscut[node] = true;
        if (false) cout << "Happiest\n";
        while (true) {
          pair<int, int> top = s.top();
          s.pop();
          ins.erase(top);
          ins.erase(make_pair(top.second, top.first));
          group[counter].insert(top.first);
          group[counter].insert(top.second);
          if (top == make_pair(w, node) || top == make_pair(node, w)) break;
        }
        counter++;
      }
      low[node] = min(low[node], low[w]);
    } else if (w != father[node]) {
      low[node] = min(low[node], dfn[w]);
    }
  }
}
int parity[100001];
int Rank[100001];
vector<int> evenGroupOf[100001];
set<int> evenClusterOf[100001];
int islandOf[100001];
int isEven[100001];
int parent[100001];
set<int> clusterAlpha[100001];
set<int> evenCluster[100001];
map<pair<int, int>, bool> answercache;
int find(int n) {
  if (parent[n] != n) parent[n] = find(parent[n]);
  return parent[n];
}
void join(int a, int b) {
  a = find(a);
  b = find(b);
  if (Rank[a] > Rank[b]) {
    parent[a] = b;
  } else if (Rank[a] < Rank[b]) {
    parent[b] = a;
  } else {
    parent[a] = b;
    Rank[b]++;
  }
}
void addToGroup(int node, int g) {
  if (group[g].count(node) == 1) return;
  seen[node] = true;
  group[g].insert(node);
  if (iscut[node]) return;
  for (int i = 0; i < adj[node].size(); i++) {
    addToGroup(adj[node][i], g);
  }
}
bool findEven(int node, int g, int p = -1) {
  seen[node] = true;
  if (group[g].count(node) == 0) return 1;
  if (parity[node] == p) return 1;
  if (parity[node] == p * -1) return 0;
  parity[node] = p;
  for (int i = 0; i < adj[node].size(); i++) {
    if (findEven(adj[node][i], g, p * -1) == 0) {
      return 0;
    }
  }
  return 1;
}
bool parityOf(int g) {
  if (isEven[g] == 0) {
    if (findEven(*group[g].begin(), g) == 1) {
      isEven[g] = 1;
    } else {
      isEven[g] = -1;
    }
    for (set<int>::iterator i = group[g].begin(); i != group[g].end(); i++) {
      parity[*i] = 0;
    }
  }
  return (isEven[g] == 1 ? 0 : 1);
}
void addToIsland(int node, int island) {
  if (seen[node]) return;
  seen[node] = true;
  islandOf[node] = island;
  for (int i = 0; i < adj[node].size(); i++) {
    addToIsland(adj[node][i], island);
  }
}
void findclusterp(int node, int cluster, int parity = -1) {
  if (false) cout << "Hi\n";
  if (seen[node] == cluster) return;
  if (evenCluster[cluster].count(node) == 0) return;
  seen[node] = cluster;
  if (false) cout << node << " " << parity << "\n";
  if (parity == 1) clusterAlpha[cluster].insert(node);
  for (int i = 0; i < adj[node].size(); i++) {
    findclusterp(adj[node][i], cluster, parity * -1);
  }
}
int main() {
  cin >> nodes >> edges;
  for (int i = 0; i < edges; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    adjset[a].insert(b);
    adjset[b].insert(a);
  }
  for (int i = 1; i <= nodes; i++) seen[i] = false;
  for (int i = 1; i <= nodes; i++) {
    if (!seen[i]) {
      addToIsland(i, i);
      findComponents(i);
    }
  }
  if (false) {
    for (int i = 1; i <= nodes; i++) {
      if (iscut[i]) cout << i << "," << low[i] << "," << depth[i] << " ";
    }
    cout << "\n";
  }
  for (int i = 1; i <= nodes; i++) parent[i] = i;
  for (int i = 1; i <= nodes; i++) {
    seen[i] = false;
  }
  for (int i = 1; i <= nodes; i++) {
    seen[i] = false;
  }
  for (int i = 0; i < counter; i++) {
    if (parityOf(i) == 0) {
      for (set<int>::iterator j = group[i].begin(); j != group[i].end(); j++) {
        evenGroupOf[*j].push_back(i);
      }
    }
  }
  for (int i = 0; i <= nodes; i++) {
    if (evenGroupOf[i].size() <= 1) continue;
    for (int j = 1; j < evenGroupOf[i].size(); j++) {
      join(evenGroupOf[i][j - 1], evenGroupOf[i][j]);
    }
  }
  for (int i = 1; i <= nodes; i++) {
    for (int j = 0; j < evenGroupOf[i].size(); i++) {
      evenClusterOf[i].insert(find(evenGroupOf[i][j]));
      evenCluster[find(evenGroupOf[i][j])].insert(i);
    }
  }
  for (int i = 0; i <= nodes; i++) seen[i] = -1;
  for (int i = 0; i <= nodes; i++) {
    if (false) cout << evenCluster[i].size() << " ";
    if (evenCluster[i].size() >= 1) {
      findclusterp(*evenCluster[i].begin(), i);
    }
  }
  if (false) {
    cout << "#groups: " << counter << "\n";
    for (int i = 0; i < counter; i++) {
      for (set<int>::iterator j = group[i].begin(); j != group[i].end(); j++) {
        cout << (*j) << " ";
      }
      cout << "(" << find(i) << ")";
      if (parityOf(i) == 0) {
        cout << "E "
             << " (";
        for (set<int>::iterator j = clusterAlpha[find(i)].begin();
             j != clusterAlpha[find(i)].end(); j++) {
          cout << *j << " ";
        }
        cout << ")";
      }
      cout << "\n";
    }
  }
  int queries;
  cin >> queries;
  for (int i = 0; i < queries; i++) {
    int a, b;
    cin >> a >> b;
    if (answercache.count(make_pair(a, b)) == 1) {
      cout << (answercache[make_pair(a, b)] ? "Yes\n" : "No\n");
      continue;
    }
    bool ans;
    if (islandOf[a] != islandOf[b]) {
      ans = 0;
    } else if (a == b) {
      ans = 0;
    } else {
      ans = 1;
      int inCommon = -1;
      for (set<int>::iterator j = evenClusterOf[a].begin();
           j != evenClusterOf[a].end(); j++) {
        if (evenClusterOf[b].count(*j) == 1) {
          ans = 0;
          inCommon = *j;
        }
      }
      if (ans == 0) {
        if (clusterAlpha[inCommon].count(a) !=
            clusterAlpha[inCommon].count(b)) {
          ans = 1;
        }
      }
    }
    answercache[make_pair(a, b)] = ans;
    cout << (ans ? "Yes\n" : "No\n");
  }
}