#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MX = 4e5 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
const int xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
int pct(int x) { return __builtin_popcount(x); }
namespace input {
template <class T>
void re(complex<T>& x);
template <class T1, class T2>
void re(pair<T1, T2>& p);
template <class T>
void re(vector<T>& a);
template <class T, size_t SZ>
void re(array<T, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(double& x) {
  string t;
  re(t);
  x = stod(t);
}
void re(long double& x) {
  string t;
  re(t);
  x = stold(t);
}
template <class T, class... Ts>
void re(T& t, Ts&... ts) {
  re(t);
  re(ts...);
}
template <class T>
void re(complex<T>& x) {
  T a, b;
  re(a, b);
  x = {a, b};
}
template <class T1, class T2>
void re(pair<T1, T2>& p) {
  re(p.first, p.second);
}
template <class T>
void re(vector<T>& a) {
  for (int i = (0); i < ((int)a.size()); ++i) re(a[i]);
}
template <class T, size_t SZ>
void re(array<T, SZ>& a) {
  for (int i = (0); i < (SZ); ++i) re(a[i]);
}
}  // namespace input
using namespace input;
namespace output {
void pr(int x) { cout << x; }
void pr(long x) { cout << x; }
void pr(long long x) { cout << x; }
void pr(unsigned x) { cout << x; }
void pr(unsigned long x) { cout << x; }
void pr(unsigned long long x) { cout << x; }
void pr(float x) { cout << x; }
void pr(double x) { cout << x; }
void pr(long double x) { cout << x; }
void pr(char x) { cout << x; }
void pr(const char* x) { cout << x; }
void pr(const string& x) { cout << x; }
void pr(bool x) { pr(x ? "true" : "false"); }
template <class T>
void pr(const complex<T>& x) {
  cout << x;
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x);
template <class T>
void pr(const T& x);
template <class T, class... Ts>
void pr(const T& t, const Ts&... ts) {
  pr(t);
  pr(ts...);
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x) {
  pr("{", x.first, ", ", x.second, "}");
}
template <class T>
void pr(const T& x) {
  pr("{");
  bool fst = 1;
  for (const auto& a : x) pr(!fst ? ", " : "", a), fst = 0;
  pr("}");
}
void ps() { pr("\n"); }
template <class T, class... Ts>
void ps(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pr(" ");
  ps(ts...);
}
void pc() { pr("]\n"); }
template <class T, class... Ts>
void pc(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pr(", ");
  pc(ts...);
}
}  // namespace output
using namespace output;
namespace io {
void setIn(string second) { freopen(second.c_str(), "r", stdin); }
void setOut(string second) { freopen(second.c_str(), "w", stdout); }
void setIO(string second = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if ((int)second.size()) {
    setIn(second + ".in"), setOut(second + ".out");
  }
}
}  // namespace io
using namespace io;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
template <int SZ>
struct LCA {
  static const int BITS = 32 - __builtin_clz(SZ);
  int N, R = 1, par[BITS][SZ], depth[SZ];
  vector<int> adj[SZ];
  void ae(int u, int v) { adj[u].push_back(v), adj[v].push_back(u); }
  void dfs(int u, int prev) {
    par[0][u] = prev;
    depth[u] = depth[prev] + 1;
    for (auto& v : adj[u])
      if (v != prev) dfs(v, u);
  }
  void init(int _N) {
    N = _N;
    dfs(R, 0);
    for (int k = (1); k < (BITS); ++k)
      for (int i = (1); i < (N + 1); ++i) par[k][i] = par[k - 1][par[k - 1][i]];
  }
  int getPar(int a, int b) {
    for (int k = (BITS)-1; k >= (0); --k)
      if (b & (1 << k)) a = par[k][a];
    return a;
  }
  int lca(int u, int v) {
    if (depth[u] < depth[v]) swap(u, v);
    u = getPar(u, depth[u] - depth[v]);
    for (int k = (BITS)-1; k >= (0); --k)
      if (par[k][u] != par[k][v]) u = par[k][u], v = par[k][v];
    return u == v ? u : par[0][u];
  }
  int dist(int u, int v) { return depth[u] + depth[v] - 2 * depth[lca(u, v)]; }
};
LCA<MX> L;
int n, k, r, close[MX], dist[MX];
struct DSU {
  vector<int> e;
  void init(int n) { e = vector<int>(n, -1); }
  int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
  bool sameSet(int a, int b) { return get(a) == get(b); }
  int size(int x) { return -e[get(x)]; }
  bool unite(int x, int y) {
    x = get(x), y = get(y);
    if (x == y) return 0;
    if (e[x] > e[y]) swap(x, y);
    e[x] += e[y];
    e[y] = x;
    return 1;
  }
};
DSU D;
int col(int a, int b, int k) {
  int x = L.lca(a, b);
  if (k <= L.dist(a, x)) {
    return D.get(close[L.getPar(a, k)]);
  }
  return D.get(close[L.getPar(b, L.dist(a, b) - k)]);
}
int main() {
  setIO();
  re(n, k, r);
  for (int i = (0); i < (n - 1); ++i) {
    int x, y;
    re(x, y);
    L.ae(n + 1 + i, x);
    L.ae(n + 1 + i, y);
  }
  vector<int> R(r);
  re(R);
  L.init(2 * n);
  D.init(2 * n);
  for (int i = (1); i < (2 * n + 1); ++i) dist[i] = MOD;
  queue<int> q;
  for (auto& t : R) {
    dist[t] = 0;
    close[t] = t;
    q.push(t);
  }
  while ((int)q.size()) {
    int x = q.front();
    q.pop();
    if (dist[x] < k) {
      for (auto& t : L.adj[x])
        if (dist[t] == MOD) {
          dist[t] = dist[x] + 1;
          close[t] = close[x];
          q.push(t);
        } else
          D.unite(close[t], close[x]);
    }
  }
  int v;
  re(v);
  for (int i = (0); i < (v); ++i) {
    int a, b;
    re(a, b);
    bool ret = 0;
    if (L.dist(a, b) <= 2 * k)
      ret = 1;
    else {
      int x = col(a, b, k), y = col(b, a, k);
      ret = (x && y && x == y);
    }
    if (ret)
      ps("YES");
    else
      ps("NO");
  }
}

### Prompt

In Cpp, your task is to solve the following problem:

Bessie is planning a vacation! In Cow-lifornia, there are n cities, with n-1 bidirectional roads connecting them. It is guaranteed that one can reach any city from any other city. 

Bessie is considering v possible vacation plans, with the i-th one consisting of a start city a_i and destination city b_i.

It is known that only r of the cities have rest stops. Bessie gets tired easily, and cannot travel across more than k consecutive roads without resting. In fact, she is so desperate to rest that she may travel through the same city multiple times in order to do so.

For each of the vacation plans, does there exist a way for Bessie to travel from the starting city to the destination city?

Input

The first line contains three integers n, k, and r (2 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ k,r ≤ n) — the number of cities, the maximum number of roads Bessie is willing to travel through in a row without resting, and the number of rest stops.

Each of the following n-1 lines contain two integers x_i and y_i (1 ≤ x_i, y_i ≤ n, x_i ≠ y_i), meaning city x_i and city y_i are connected by a road. 

The next line contains r integers separated by spaces — the cities with rest stops. Each city will appear at most once.

The next line contains v (1 ≤ v ≤ 2 ⋅ 10^5) — the number of vacation plans.

Each of the following v lines contain two integers a_i and b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i) — the start and end city of the vacation plan. 

Output

If Bessie can reach her destination without traveling across more than k roads without resting for the i-th vacation plan, print YES. Otherwise, print NO.

Examples

Input


6 2 1
1 2
2 3
2 4
4 5
5 6
2
3
1 3
3 5
3 6


Output


YES
YES
NO


Input


8 3 3
1 2
2 3
3 4
4 5
4 6
6 7
7 8
2 5 8
2
7 1
8 1


Output


YES
NO

Note

The graph for the first example is shown below. The rest stop is denoted by red.

For the first query, Bessie can visit these cities in order: 1, 2, 3.

For the second query, Bessie can visit these cities in order: 3, 2, 4, 5. 

For the third query, Bessie cannot travel to her destination. For example, if she attempts to travel this way: 3, 2, 4, 5, 6, she travels on more than 2 roads without resting.

<image>

The graph for the second example is shown below. 

<image>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MX = 4e5 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
const int xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
int pct(int x) { return __builtin_popcount(x); }
namespace input {
template <class T>
void re(complex<T>& x);
template <class T1, class T2>
void re(pair<T1, T2>& p);
template <class T>
void re(vector<T>& a);
template <class T, size_t SZ>
void re(array<T, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(double& x) {
  string t;
  re(t);
  x = stod(t);
}
void re(long double& x) {
  string t;
  re(t);
  x = stold(t);
}
template <class T, class... Ts>
void re(T& t, Ts&... ts) {
  re(t);
  re(ts...);
}
template <class T>
void re(complex<T>& x) {
  T a, b;
  re(a, b);
  x = {a, b};
}
template <class T1, class T2>
void re(pair<T1, T2>& p) {
  re(p.first, p.second);
}
template <class T>
void re(vector<T>& a) {
  for (int i = (0); i < ((int)a.size()); ++i) re(a[i]);
}
template <class T, size_t SZ>
void re(array<T, SZ>& a) {
  for (int i = (0); i < (SZ); ++i) re(a[i]);
}
}  // namespace input
using namespace input;
namespace output {
void pr(int x) { cout << x; }
void pr(long x) { cout << x; }
void pr(long long x) { cout << x; }
void pr(unsigned x) { cout << x; }
void pr(unsigned long x) { cout << x; }
void pr(unsigned long long x) { cout << x; }
void pr(float x) { cout << x; }
void pr(double x) { cout << x; }
void pr(long double x) { cout << x; }
void pr(char x) { cout << x; }
void pr(const char* x) { cout << x; }
void pr(const string& x) { cout << x; }
void pr(bool x) { pr(x ? "true" : "false"); }
template <class T>
void pr(const complex<T>& x) {
  cout << x;
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x);
template <class T>
void pr(const T& x);
template <class T, class... Ts>
void pr(const T& t, const Ts&... ts) {
  pr(t);
  pr(ts...);
}
template <class T1, class T2>
void pr(const pair<T1, T2>& x) {
  pr("{", x.first, ", ", x.second, "}");
}
template <class T>
void pr(const T& x) {
  pr("{");
  bool fst = 1;
  for (const auto& a : x) pr(!fst ? ", " : "", a), fst = 0;
  pr("}");
}
void ps() { pr("\n"); }
template <class T, class... Ts>
void ps(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pr(" ");
  ps(ts...);
}
void pc() { pr("]\n"); }
template <class T, class... Ts>
void pc(const T& t, const Ts&... ts) {
  pr(t);
  if (sizeof...(ts)) pr(", ");
  pc(ts...);
}
}  // namespace output
using namespace output;
namespace io {
void setIn(string second) { freopen(second.c_str(), "r", stdin); }
void setOut(string second) { freopen(second.c_str(), "w", stdout); }
void setIO(string second = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if ((int)second.size()) {
    setIn(second + ".in"), setOut(second + ".out");
  }
}
}  // namespace io
using namespace io;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
template <int SZ>
struct LCA {
  static const int BITS = 32 - __builtin_clz(SZ);
  int N, R = 1, par[BITS][SZ], depth[SZ];
  vector<int> adj[SZ];
  void ae(int u, int v) { adj[u].push_back(v), adj[v].push_back(u); }
  void dfs(int u, int prev) {
    par[0][u] = prev;
    depth[u] = depth[prev] + 1;
    for (auto& v : adj[u])
      if (v != prev) dfs(v, u);
  }
  void init(int _N) {
    N = _N;
    dfs(R, 0);
    for (int k = (1); k < (BITS); ++k)
      for (int i = (1); i < (N + 1); ++i) par[k][i] = par[k - 1][par[k - 1][i]];
  }
  int getPar(int a, int b) {
    for (int k = (BITS)-1; k >= (0); --k)
      if (b & (1 << k)) a = par[k][a];
    return a;
  }
  int lca(int u, int v) {
    if (depth[u] < depth[v]) swap(u, v);
    u = getPar(u, depth[u] - depth[v]);
    for (int k = (BITS)-1; k >= (0); --k)
      if (par[k][u] != par[k][v]) u = par[k][u], v = par[k][v];
    return u == v ? u : par[0][u];
  }
  int dist(int u, int v) { return depth[u] + depth[v] - 2 * depth[lca(u, v)]; }
};
LCA<MX> L;
int n, k, r, close[MX], dist[MX];
struct DSU {
  vector<int> e;
  void init(int n) { e = vector<int>(n, -1); }
  int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
  bool sameSet(int a, int b) { return get(a) == get(b); }
  int size(int x) { return -e[get(x)]; }
  bool unite(int x, int y) {
    x = get(x), y = get(y);
    if (x == y) return 0;
    if (e[x] > e[y]) swap(x, y);
    e[x] += e[y];
    e[y] = x;
    return 1;
  }
};
DSU D;
int col(int a, int b, int k) {
  int x = L.lca(a, b);
  if (k <= L.dist(a, x)) {
    return D.get(close[L.getPar(a, k)]);
  }
  return D.get(close[L.getPar(b, L.dist(a, b) - k)]);
}
int main() {
  setIO();
  re(n, k, r);
  for (int i = (0); i < (n - 1); ++i) {
    int x, y;
    re(x, y);
    L.ae(n + 1 + i, x);
    L.ae(n + 1 + i, y);
  }
  vector<int> R(r);
  re(R);
  L.init(2 * n);
  D.init(2 * n);
  for (int i = (1); i < (2 * n + 1); ++i) dist[i] = MOD;
  queue<int> q;
  for (auto& t : R) {
    dist[t] = 0;
    close[t] = t;
    q.push(t);
  }
  while ((int)q.size()) {
    int x = q.front();
    q.pop();
    if (dist[x] < k) {
      for (auto& t : L.adj[x])
        if (dist[t] == MOD) {
          dist[t] = dist[x] + 1;
          close[t] = close[x];
          q.push(t);
        } else
          D.unite(close[t], close[x]);
    }
  }
  int v;
  re(v);
  for (int i = (0); i < (v); ++i) {
    int a, b;
    re(a, b);
    bool ret = 0;
    if (L.dist(a, b) <= 2 * k)
      ret = 1;
    else {
      int x = col(a, b, k), y = col(b, a, k);
      ret = (x && y && x == y);
    }
    if (ret)
      ps("YES");
    else
      ps("NO");
  }
}

```