#include<bits/stdc++.h>
using namespace std;
vector<int> aray[100000];
vector<int> euler;
int dist[100000];
void dfs(int root, int count)
{
	dist[root] = count;
	euler.push_back(root);
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(dist[val] != -1)
			continue;
		dfs(val, count+1);
		euler.push_back(root);
	}
	return ;
}
bool valid(int a, int b)
{
	if(a > b)
		return false;
	if(((a-b)%2) == 0)
		return true;
	return false;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int t = n-1;
	while(t--)
	{
		int x,y;
		cin>>x>>y;
		x--;
		y--;
		aray[x].push_back(y);
		aray[y].push_back(x);
	}
	for(int i=0;i<n;i++)
		dist[i] = -1;
	dfs(0, 0);
	int first[n];
	for(int i=euler.size()-1;i>=0;i--)
		first[euler[i]] = i;
	int m = euler.size();
	int s = sqrt(m);
	int box = ceil((double)m/s);
	int num[box];
	for(int i=0;i<box;i++)
	{
		num[i] = 1000000000;
		for(int j=i*s;j<min(m, (i+1)*s);j++)
			num[i] = min(num[i], dist[euler[j]]);
	}
	int q;
	cin>>q;
	while(q--)
	{
		int arr[4], k;
		for(int i=0;i<4;i++)
		{
			cin>>arr[i];
			arr[i]--;
		}
		cin>>k;
		int count = 0;
		bool ans = false;
		vector<int> dia;
		for(int i=0;i<2;i++)
		{
			for(int j=2;j<4;j++)
			{
				int fir = first[arr[i]], sec = first[arr[j]];
				int temp = min(fir, sec), tmep = max(fir, sec);
				fir = temp;
				sec = tmep;
				int bfir = fir/s, bsec = sec/s;
				int val = 100000000;
				if(bfir == bsec)
				{
					for(int i=fir;i<=sec;i++)
						val = min(val, dist[euler[i]]);
				}
				else
				{
					for(int i=bfir+1;i<bsec;i++)
						val = min(val, num[i]);
					for(int i=fir;i<bfir*s+s;i++)
						val = min(val, dist[euler[i]]);
					for(int i=s*bsec;i<=sec;i++)
						val = min(val, dist[euler[i]]);
				}
				int distance = dist[arr[i]]+dist[arr[j]]-2*val;
				dia.push_back(distance);
			}
		}
		if(valid(dia[0]+dia[3]+1, k))
			ans = true;
		if(valid(dia[1]+dia[2]+1, k))
			ans = true;
		int fir = first[arr[2]], sec = first[arr[3]];
		int temp = min(fir, sec), tmep = max(fir, sec);
		fir = temp;
		sec = tmep;
		int bfir = fir/s, bsec = sec/s;
		int val = 10000000;
		if(bfir == bsec)
		{
			for(int i=fir;i<=sec;i++)
				val = min(val, dist[euler[i]]);
		}
		else
		{
			for(int i=bfir+1;i<bsec;i++)
				val = min(val, num[i]);
			for(int i=fir;i<bfir*s+s;i++)
				val = min(val, dist[euler[i]]);
			for(int i=s*bsec;i<=sec;i++)
				val = min(val, dist[euler[i]]);
		}
		int distance = dist[arr[2]]+dist[arr[3]]-2*val;
		if(valid(distance, k))
			ans = true;
		if((distance<=k) && ((distance-k)%2) == 0)
			ans = true;
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector<int> aray[100001], euler;
int dist[100001], first[100001], num[700];
void dfs(int root, int count)
{
	dist[root] = count;
	first[root] = euler.size();
	euler.push_back(count);
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(dist[val] == -1)
		{
			dfs(val, count+1);
			euler.push_back(count);
		}
	}
	return ;
}
bool valid(int a, int b)
{
	int num = b-a;
	if(!(num&1) && (num >= 0))
		return true;
	return false;
}
int cal(int x, int y, int s)
{
	int temp = x, tmep = y;
	x = min(first[x], first[y]);
	y = max(first[temp], first[y]);
	int bx = x/s, by = y/s, val = euler[x];
	for(int i=bx + 1;i < by;i++)
		val = min(val, num[i]);
	for(int i=x + 1;i < min(bx*s+s, y);i++)
		val = min(val, euler[i]);
	for(int i=max(x, s*by);i <= y;i++)
		val = min(val, euler[i]);
	return dist[temp]+dist[tmep]-2*val;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int t = n-1, x, y;
	while(t--)
	{
		cin>>x>>y;
		aray[x].push_back(y);
		aray[y].push_back(x);
	}
	for(int i=1;i<=n;i++)
		first[i] = dist[i] = -1;
	dfs(1, 0);
	int m = euler.size();
	int s = sqrt(m);
	int box = ceil((double)m/s);
	for(int i=0;i<box;i++)
	{
		int start = i*s;
		num[i] = euler[start];
		for(int j=start+1;j<min(m, start+s);j++)
			num[i] = min(num[i], euler[j]);
	}
	int q;
	cin>>q;
	while(q--)
	{
		int x, y, a, b, k;
		cin>>x>>y>>a>>b>>k;
		bool ans = false;
		vector<int> distance;
		distance.push_back(cal(a, x, s) + cal(b, y, s) + 1);
		distance.push_back(cal(a, y, s) + cal(b, x, s) + 1);
		distance.push_back(cal(a, b, s));
		for(int i=0;i<3;i++)
		{
			if(valid(distance[i], k))
				ans = true;
		}
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector<int> aray[100001], euler;
int dist[100001], first[100001], num[350];
void dfs(int root, int count)
{
	dist[root] = count;
	if(first[root] == -1)
		first[root] = euler.size();
	euler.push_back(count);
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(dist[val] == -1)
		{
			dfs(val, count+1);
			euler.push_back(count);
		}
	}
	return ;
}
bool valid(int a, int b)
{
	if(a > b)
		return false;
	if(((a-b)%2) == 0)
		return true;
	return false;
}
int cal(int x, int y, int s)
{
	int temp = x, tmep = y;
	x = min(first[x], first[y]);
	y = max(first[temp], first[y]);
	int bx = x/s, by = y/s, val = euler[x];
	for(int i=bx + 1;i < by;i++)
		val = min(val, num[i]);
	for(int i=x + 1;i < min(bx*s+s, y);i++)
		val = min(val, euler[i]);
	for(int i=max(x, s*by);i <= y;i++)
		val = min(val, euler[i]);
	return dist[temp]+dist[tmep]-2*val;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int t = n-1, x, y;
	while(t--)
	{
		cin>>x>>y;
		aray[x].push_back(y);
		aray[y].push_back(x);
	}
	for(int i=1;i<=n;i++)
		first[i] = dist[i] = -1;
	dfs(1, 0);
	int m = euler.size();
	int s = sqrt(m);
	int box = ceil((double)m/s);
	for(int i=0;i<box;i++)
	{
		int start = i*s;
		num[i] = euler[start];
		for(int j=start+1;j<min(m, start+s);j++)
			num[i] = min(num[i], euler[j]);
	}
	int q;
	cin>>q;
	while(q--)
	{
		int x, y, a, b, k;
		cin>>x>>y>>a>>b>>k;
		bool ans = false;
		vector<int> distance;
		distance.push_back(cal(a, x, s) + cal(b, y, s) + 1);
		distance.push_back(cal(a, y, s) + cal(b, x, s) + 1);
		distance.push_back(cal(a, b, s));
		for(int i=0;i<3;i++)
		{
			if(valid(distance[i], k))
				ans = true;
		}
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector<int> aray[100000];
bool visit1[100000], visit2[100000];
int num1[100000], num2[100000];
void dfs1(int root, int count)
{
	visit1[root] = true;
	num1[root] = count;
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(!visit1[val])
			dfs1(val, count+1);
	}
	return ;
}
void dfs2(int root, int count)
{
	visit2[root] = true;
	num2[root] = count;
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(!visit2[val])
			dfs2(val, count+1);
	}
	return ;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int m = n-1;
	while(m--)
	{
		int x,y;
		cin>>x>>y;
		x--;
		y--;
		aray[x].push_back(y);
		aray[y].push_back(x);
	}
	int q;
	cin>>q;
	while(q--)
	{
		for(int i=0;i<n;i++)
		{
			visit1[i] = false;
			visit2[i] = false;
		}
		int x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		x--;y--;a--;b--;
		dfs1(a, 0);
		dfs2(b, 0);
		bool ans = false;
		vector<int> v;
		v.push_back(num1[b]);
		v.push_back(num1[x]+num2[y]+1);
		v.push_back(num1[y]+num2[x]+1);
		for(int i=0;i<3;i++)
		{
			if(k >= v[i])
			{
				if(((k-v[i])%2) == 0)
					ans = true;
			}
		}
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
vector<int> aray[100001], euler;
int dist[100001], first[100001], num[700];
void dfs(int root, int count)
{
	dist[root] = count;
	first[root] = euler.size();
	euler.push_back(count);
	for(int i=0;i<aray[root].size();i++)
	{
		int val = aray[root][i];
		if(dist[val] == -1)
		{
			dfs(val, count+1);
			euler.push_back(count);
		}
	}
	return ;
}
bool valid(int a, int b)
{
	int num = a-b;
	if(!(num&1) && (num > 0))
		return true;
	return false;
}
int cal(int x, int y, int s)
{
	int temp = x, tmep = y;
	x = min(first[x], first[y]);
	y = max(first[temp], first[y]);
	int bx = x/s, by = y/s, val = euler[x];
	for(int i=bx + 1;i < by;i++)
		val = min(val, num[i]);
	for(int i=x + 1;i < min(bx*s+s, y);i++)
		val = min(val, euler[i]);
	for(int i=max(x, s*by);i <= y;i++)
		val = min(val, euler[i]);
	return dist[temp]+dist[tmep]-2*val;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int t = n-1, x, y;
	while(t--)
	{
		cin>>x>>y;
		aray[x].push_back(y);
		aray[y].push_back(x);
	}
	for(int i=1;i<=n;i++)
		first[i] = dist[i] = -1;
	dfs(1, 0);
	int m = euler.size();
	int s = sqrt(m);
	int box = ceil((double)m/s);
	for(int i=0;i<box;i++)
	{
		int start = i*s;
		num[i] = euler[start];
		for(int j=start+1;j<min(m, start+s);j++)
			num[i] = min(num[i], euler[j]);
	}
	int q;
	cin>>q;
	while(q--)
	{
		int x, y, a, b, k;
		cin>>x>>y>>a>>b>>k;
		bool ans = false;
		vector<int> distance;
		distance.push_back(cal(a, x, s) + cal(b, y, s) + 1);
		distance.push_back(cal(a, y, s) + cal(b, x, s) + 1);
		distance.push_back(cal(a, b, s));
		for(int i=0;i<3;i++)
		{
			if(valid(distance[i], k))
				ans = true;
		}
		if(ans)
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

template< typename G >
class DoublingLowestCommonAncestor {
public:
  const G &g;
  vector< int > depth;//depth[v]=根からvまでの距離
  const int LOG;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), depth(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    depth[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build(int v) {
    dfs(v, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0,tablesize = table[k].size(); i < tablesize; i++) {
	if(table[k][i] == -1) table[k + 1][i] = -1;
	else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((depth[v] - depth[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
	u = table[i][u];
	v = table[i][v];
      }
    }
    return table[0][u];
  }
};
vvi E(111111);
vi dist(111111);
void dfs(ll now,ll par,ll di){
  dist[now] = di;

  for(auto e:E[now]){
    if(e == par)continue;
    dfs(e,now,di+1);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i = 0;i < n-1;i++){
    ll a,b;cin>>a>>b;
    a--;b--;
    E[a].pb(b);
    E[b].pb(a);
  }
  DoublingLowestCommonAncestor<vvi> lca(E);
  lca.build(0);
  dfs(0,-1,0);
  ll q;cin>>q;
  //for(int i=0;i<n;i++)cout<<dist[i]<<" ";cout<<endl;
  while(q--){
    ll x,y,a,b,k;
    cin>>x>>y>>a>>b>>k;
    x--;y--;a--;b--;
    ll dist_ab = dist[a]+dist[b]-2*dist[lca.query(a,b)];

    ll dist_ax = dist[a]+dist[x]-2*dist[lca.query(a,x)];
    ll dist_ay = dist[a]+dist[y]-2*dist[lca.query(a,y)];
    ll dist_bx = dist[b]+dist[x]-2*dist[lca.query(b,x)];
    ll dist_by = dist[b]+dist[y]-2*dist[lca.query(b,y)];
    ll dist_xy = dist[x]+dist[y]-2*dist[lca.query(x,y)];

    ll min_dist = min(dist_ax+dist_by+1,dist_ay+dist_bx+1);
    if(min(dist_ab,min_dist) > k){
      cout<<"NO"<<endl;
      continue;
    }

    //cout<<k-dist_ab<<" "<<k-min_dist<<endl;
    if(((k-dist_ab)%2 == 0) || ((k-min_dist)%2 == 0)){
      cout<<"YES"<<endl;
      continue;
    }
    if(dist_xy % 2 == 0){
      //pattern ax -> xb;
      ll tk = k;
      tk-=(dist_ax+dist_bx);
      if(tk >= 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> yb;
      tk = k;
      tk-=(dist_ay+dist_by);
      if(tk >= 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ax -> yb;
      tk = k;
      tk-=(dist_ax+dist_by+dist_xy);
      if(tk >= 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> xb;
      tk = k;
      tk-=(dist_ay+dist_bx+dist_xy);
      if(tk >= 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }

    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

template< typename G >
class DoublingLowestCommonAncestor {
public:
  const G &g;
  vector< int > depth;//depth[v]=根からvまでの距離
  const int LOG;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), depth(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    depth[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build(int v) {
    dfs(v, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0,tablesize = table[k].size(); i < tablesize; i++) {
	if(table[k][i] == -1) table[k + 1][i] = -1;
	else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((depth[v] - depth[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
	u = table[i][u];
	v = table[i][v];
      }
    }
    return table[0][u];
  }
};
vvi E(111111);
vi dist(111111);
void dfs(ll now,ll par,ll di){
  dist[now] = di;

  for(auto e:E[now]){
    if(e == par)continue;
    dfs(e,now,di+1);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i = 0;i < n-1;i++){
    ll a,b;cin>>a>>b;
    a--;b--;
    E[a].pb(b);
    E[b].pb(a);
  }
  DoublingLowestCommonAncestor<vvi> lca(E);
  lca.build(0);
  dfs(0,-1,0);
  ll q;cin>>q;
  //for(int i=0;i<n;i++)cout<<dist[i]<<" ";cout<<endl;
  while(q--){
    ll x,y,a,b,k;
    cin>>x>>y>>a>>b>>k;
    x--;y--;a--;b--;
    ll dist_ab = dist[a]+dist[b]-2*dist[lca.query(a,b)];

    ll dist_ax = dist[a]+dist[x]-2*dist[lca.query(a,x)];
    ll dist_ay = dist[a]+dist[y]-2*dist[lca.query(a,y)];
    ll dist_bx = dist[b]+dist[x]-2*dist[lca.query(b,x)];
    ll dist_by = dist[b]+dist[y]-2*dist[lca.query(b,y)];
    ll dist_xy = dist[x]+dist[y]-2*dist[lca.query(x,y)];
    if(dist_ab <= k && dist_ab % 2 == k % 2){
      cout<<"YES"<<endl;
    }else if((dist_ax+dist_by+1) <= k &&(dist_ax+dist_by+1)%2 == k%2){
      cout<<"YES"<<endl;
    }else if((dist_ay+dist_bx+1) <= k && (dist_ay+dist_bx+1)%2 == k%2){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

template< typename G >
class DoublingLowestCommonAncestor {
public:
  const G &g;
  vector< int > depth;//depth[v]=根からvまでの距離
  const int LOG;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), depth(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    depth[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build(int v) {
    dfs(v, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0,tablesize = table[k].size(); i < tablesize; i++) {
	if(table[k][i] == -1) table[k + 1][i] = -1;
	else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((depth[v] - depth[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
	u = table[i][u];
	v = table[i][v];
      }
    }
    return table[0][u];
  }
};
vvi E(111111);
vi dist(111111);
void dfs(ll now,ll par,ll di){
  dist[now] = di;

  for(auto e:E[now]){
    if(e == par)continue;
    dfs(e,now,di+1);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i = 0;i < n-1;i++){
    ll a,b;cin>>a>>b;
    a--;b--;
    E[a].pb(b);
    E[b].pb(a);
  }
  DoublingLowestCommonAncestor<vvi> lca(E);
  lca.build(0);
  dfs(0,-1,0);
  ll q;cin>>q;
  //for(int i=0;i<n;i++)cout<<dist[i]<<" ";cout<<endl;
  while(q--){
    ll x,y,a,b,k;
    cin>>x>>y>>a>>b>>k;
    x--;y--;a--;b--;
    ll dist_ab = dist[a]+dist[b]-2*dist[lca.query(a,b)];

    ll dist_ax = dist[a]+dist[x]-2*dist[lca.query(a,x)];
    ll dist_ay = dist[a]+dist[y]-2*dist[lca.query(a,y)];
    ll dist_bx = dist[b]+dist[x]-2*dist[lca.query(b,x)];
    ll dist_by = dist[b]+dist[y]-2*dist[lca.query(b,y)];
    ll dist_xy = dist[x]+dist[y]-2*dist[lca.query(x,y)];

    ll min_dist = min(dist_ax+dist_by+1,dist_ay+dist_bx+1);
    if(min(dist_ab,min_dist) > k){
      cout<<"NO"<<endl;
      continue;
    }
    //cout<<k-dist_ab<<" "<<k-min_dist<<endl;
    if(((k-dist_ab)%2 == 0) || ((k-min_dist)%2 == 0)){
      cout<<"YES"<<endl;
      continue;
    }
    if(dist_xy % 2 == 0){
      //pattern ax -> xb;
      ll tk = k;
      tk-=(dist_ax+dist_bx);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> yb;
      tk = k;
      tk-=(dist_ay+dist_by);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ax -> yb;
      tk = k;
      tk-=(dist_ax+dist_by+dist_xy);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> xb;
      tk = k;
      tk-=(dist_ay+dist_bx+dist_xy);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }

    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

template< typename G >
class DoublingLowestCommonAncestor {
public:
  const G &g;
  vector< int > depth;//depth[v]=根からvまでの距離
  const int LOG;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), depth(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    depth[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build(int v) {
    dfs(v, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0,tablesize = table[k].size(); i < tablesize; i++) {
	if(table[k][i] == -1) table[k + 1][i] = -1;
	else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((depth[v] - depth[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
	u = table[i][u];
	v = table[i][v];
      }
    }
    return table[0][u];
  }
};
vvi E(111111);
vi dist(111111);
void dfs(ll now,ll par,ll di){
  dist[now] = di;
  cout<<now<<" "<<par<<" "<<di<<endl;
  for(auto e:E[now]){
    if(e == par)continue;
    dfs(e,now,di+1);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i = 0;i < n-1;i++){
    ll a,b;cin>>a>>b;
    a--;b--;
    E[a].pb(b);
    E[b].pb(a);
  }
  DoublingLowestCommonAncestor<vvi> lca(E);
  lca.build(0);
  dfs(0,-1,0);
  ll q;cin>>q;
  //for(int i=0;i<n;i++)cout<<dist[i]<<" ";cout<<endl;
  while(q--){
    ll x,y,a,b,k;
    cin>>x>>y>>a>>b>>k;
    x--;y--;a--;b--;
    ll dist_ab = dist[a]+dist[b]-2*dist[lca.query(a,b)];

    ll dist_ax = dist[a]+dist[x]-2*dist[lca.query(a,x)];
    ll dist_ay = dist[a]+dist[y]-2*dist[lca.query(a,y)];
    ll dist_bx = dist[b]+dist[x]-2*dist[lca.query(b,x)];
    ll dist_by = dist[b]+dist[y]-2*dist[lca.query(b,y)];
    ll dist_xy = dist[x]+dist[y]-2*dist[lca.query(x,y)];

    ll min_dist = min(dist_ax+dist_by+1,dist_ay+dist_bx+1);
    if(min(dist_ab,min_dist) > k){
      cout<<"NO"<<endl;
      continue;
    }
    //cout<<k-dist_ab<<" "<<k-min_dist<<endl;
    if(((k-dist_ab)%2 == 0) || ((k-min_dist)%2 == 0)){
      cout<<"YES"<<endl;
      continue;
    }
    if(dist_xy % 2 == 0){
      //pattern ax -> xb;
      ll tk = k;
      tk-=(dist_ax+dist_bx);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> yb;
      tk = k;
      tk-=(dist_ay+dist_by);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ax -> yb;
      tk = k;
      tk-=(dist_ax+dist_by+dist_xy);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }
      //pattern ay -> xb;
      tk = k;
      tk-=(dist_ay+dist_bx+dist_xy);
      if(tk > 0){
	if(tk % (dist_xy+1) == 0){
	  cout<<"YES"<<endl;
	  continue;
	}
      }

    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

template< typename G >
class DoublingLowestCommonAncestor {
public:
  const G &g;
  vector< int > depth;//depth[v]=根からvまでの距離
  const int LOG;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), depth(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    depth[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build(int v) {
    dfs(v, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0,tablesize = table[k].size(); i < tablesize; i++) {
	if(table[k][i] == -1) table[k + 1][i] = -1;
	else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((depth[v] - depth[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
	u = table[i][u];
	v = table[i][v];
      }
    }
    return table[0][u];
  }
};
vvi E(111111);
vi dist(111111);
void dfs(ll now,ll par,ll di){
  dist[now] = di;

  for(auto e:E[now]){
    if(e == par)continue;
    dfs(e,now,di+1);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i = 0;i < n-1;i++){
    ll a,b;cin>>a>>b;
    a--;b--;
    E[a].pb(b);
    E[b].pb(a);
  }
  DoublingLowestCommonAncestor<vvi> lca(E);
  lca.build(0);
  dfs(0,-1,0);
  ll q;cin>>q;
  //for(int i=0;i<n;i++)cout<<dist[i]<<" ";cout<<endl;
  while(q--){
    ll x,y,a,b,k;
    cin>>x>>y>>a>>b>>k;
    x--;y--;a--;b--;
    ll dist_ab = dist[a]+dist[b]-2*dist[lca.query(a,b)];

    ll dist_ax = dist[a]+dist[x]-2*dist[lca.query(a,x)];
    ll dist_ay = dist[a]+dist[y]-2*dist[lca.query(a,y)];
    ll dist_bx = dist[b]+dist[x]-2*dist[lca.query(b,x)];
    ll dist_by = dist[b]+dist[y]-2*dist[lca.query(b,y)];
    ll dist_xy = dist[x]+dist[y]-2*dist[lca.query(x,y)];
    if(dist_ab <= k && dist_ab % 2 == k % 2){
      cout<<"YES"<<endl;
    }else if((dist_ax+dist_by) <= k &&(dist_ax+dist_by)%2 == k%2){
      cout<<"YES"<<endl;
    }else if((dist_ay+dist_bx) <= k && (dist_ay+dist_bx)%2 == k%2){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][18];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i <= 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
bool lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 18; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        int v,w;
        int d1=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b))+1;
        int d2=trdist(a,b);
        if((d1%2==k%2 && d1<=k) || (d2%2==k%2 && d2<=k))
        {
            cout<<"YES\n";
            continue;
        }
        if(d1 <=k && d2<=k )
        {
            if(d1+d2<=k)
            {
                cout<<"YES\n";
                continue;
            }
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][20];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i < 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
int lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 17; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        int d1=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b))+1;
        int d2=trdist(a,b);
        if((d1%2==k%2 && d1<=k) || (d2%2==k%2 && d2<=k))
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][20];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i < 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
int lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 18; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        int d1=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b))+1;
        int d2=trdist(a,b);
        if((d1%2==k%2 && d1<=k) || (d2%2==k%2 && d2<=k))
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][20];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i < 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
int lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 17; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        k-=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b));
        if(k<0)
        {
            cout<<"NO\n";
            continue;
        }
        if(k&1)
        {
            cout<<"YES\n";
            continue;
        }
        int d=trdist(x,y);
        if(d%2==0 && d<=k)
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][18];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i <= 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
bool lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 18; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        k-=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b));
        if(k<0)
        {
            cout<<"NO\n";
            continue;
        }
        if(k&1)
        {
            cout<<"YES\n";
            continue;
        }
        int d=trdist(x,y);
        if(d%2==0 && d<=k)
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][18];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i <= 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
bool lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 18; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        int v,w;
        int d1=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b))+1;
        int d2=trdist(a,b);
        if((d1%2==k%2 && d1<=k) || (d2%2==k%2 && d2<=k))
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
#define _boost ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define fi first
#define se second
#define clz __builtin_clz
#define clzll __builtin_clzll
#define bp __builtin_popcount
#define _unique(x) sort((x).begin(),(x).end()),(x).erase(unique((x).begin(), (x).end()),(x.end()))
#define all(x) (x).begin(),(x).end()

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;
typedef pair < LD, LD > PDD;

const LL MOD = 998244353;//1e9+7;
const LL LLINF = 1e18+7;

vector<vector<int>> G(100009);
int up[100009][20];
int tin[100009],tout[100009];
int timee=1;
void dfs(int v,int p)
{
    up[v][0]=p;
    tin[v]=timee++;
    for (int i = 1; i <= 18; ++i)
        up[v][i] = up[up[v][i-1]][i-1];
    for(int u:G[v])
    {
        if(u!=p)
        {
            dfs(u,v);
        }
    }
    tout[v]=timee++;
}
bool is_ancestor(int v, int u)
{
    return (tin[v]<=tin[u] && tout[v]>= tout[u]) ;
}
bool lca(int v,int u)
{
    if(is_ancestor(v,u)) return v;
    if(is_ancestor(u,v)) return u;
    for (int i = 18; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}
int dist(int v, int u)
{
    ///v is ancestor of u
    int d=0;
    if(v==u) return 0;
    for (int i = 17; i >= 0; --i)
    {
        if (!is_ancestor(up[u][i], v ))
        {
            u = up[u][i];
            d+=(1<<i);
        }
    }
    return d+1;
}
int trdist(int v, int u)
{
    int w=lca(v,u);
    if(is_ancestor(v,u)) return dist(v,u);
    if(is_ancestor(u,v)) return dist(u,v);
    return dist(w,v) + dist(w,u);
}
int main()
{
    _boost;
    int n,q;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs(1,1);
    //cout<<is_ancestor(3,4)<<" "<<trdist(3,4)<<'\n'<<lca(1,2)<<"\n";
    cin>>q;
    while(q--)
    {
        int x,y,a,b,k;
        cin>>x>>y>>a>>b>>k;
        //cout<<trdist(x,y)<<'\n';
        int d1=min(trdist(a,x)+trdist(y,b),trdist(a,y)+trdist(x,b))+1;
        int d2=trdist(a,b);
        if((d1%2==k%2 && d1<=k) || (d2%2==k%2 && d2<=k))
        {
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

    }
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 17;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void lca_dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

void lca_preprocess(int root) {
	memset(up, -1, sizeof up);
	dfs(root, -1);
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	lca_preprocess(1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 17;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void lca_dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		lca_dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

void lca_preprocess(int root) {
	memset(up, -1, sizeof up);
	lca_dfs(root, -1);
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	lca_preprocess(1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 17;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	dfs(1, -1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 17;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void lca_dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		lca_dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

void lca_preprocess(int root) {
	memset(up, -1, sizeof up);
	lca_dfs(root, -1);
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	lca_preprocess(1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 17;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	dfs(1, -1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, x) + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, y) + dist(y, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int LG = 14;
int n, q;
vector<int> adjList[N];

int depth[N], up[LG][N];

void dfs(int v, int p) {
	for (int i = 1; i < LG; i++) {
		int u = up[i - 1][v];
		if (u == -1) break;
		up[i][v] = up[i - 1][u];
	}

	for (int u : adjList[v]) {
		if (u == p) continue;

		depth[u] = depth[v] + 1;
		up[0][u] = v;
		dfs(u, v);
	}
}

void walk(int &v, int k) {
	for (int i = 0; i < LG; i++) {
		if (k & (1 << i)) {
			v = up[i][v];
		}
	}
}

int dist(int v, int u) {
	if (depth[v] < depth[u]) {
		swap(u, v);
	}

	int ou = u;
	int ov = v;

	walk(v, depth[v] - depth[u]);

	if (u == v) {
		return depth[ov] - depth[v];
	}

	for (int i = LG - 1; i >= 0; i--) {
		if (up[i][v] != up[i][u]) {
			v = up[i][v], u = up[i][u];
		}
	}

	int lca = up[0][v];

	return depth[ou] + depth[ov] - 2 * depth[lca];
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	int a, b;
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		adjList[a].emplace_back(b);
		adjList[b].emplace_back(a);
	}

	dfs(1, -1);

	cin >> q;

	int x, y, u, v, k;
	for (int i = 0; i < q; i++) {
		cin >> x >> y >> u >> v >> k;

		int par = k % 2;

		int d = dist(u, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, x) + 1 + dist(y, v);
		if (k >= d && d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		d = dist(u, y) + 1 + dist(x, v);
		if (d % 2 == par) {
			cout << "YES\n";
			continue;
		}

		cout << "NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()
#define pi                  3.14159265359
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

const int N=1e5+10;
int n,l;
vector<int> adj[N];
vector<vector<int>> up;
int timer;
vector<int> tin(N), tout(N);

void dfs(int v, int p)
{
    tin[v] = ++timer;
    up[v][0] = p;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (int u : adj[v]) {
        if (u != p)
            dfs(u, v);
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[v] <= tout[u];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    timer = 0;
    l = ceil(log2(n));
    up.assign(n+1, vector<int>(l + 1));
    dfs(root, root);
}

ll dis[N];
bool vis[N];
void bfs(int s)
{
    queue<int> q;
    q.push(s);
    vis[s]=true;
    while(!q.empty())
    {
        int now=q.front();
        q.pop();
        for(auto to : adj[now])
        {
            if(!vis[to])
            {
                vis[to]=true;
                q.push(to);
                dis[to]=dis[now]+1;
            }
        }
    }
}

int main()
{
    fastio;
    cin>>n;
    rep(i,0,n-1)
    {
        int a,b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    preprocess(1);
    bfs(1);

    int q;cin>>q;
    while(q--)
    {
        ll u,v,x,y,k;cin>>x>>y>>u>>v>>k;
        int anc=lca(u,v);
        ll L1=dis[u]+dis[v]-2*dis[anc];
        int lcaux=lca(u,x),lcauy=lca(u,y);
        int lcavx=lca(v,x),lcavy=lca(v,y);

        ll L2=dis[u]+dis[x]-2*dis[lcaux]+1+dis[y]+dis[v]-2*dis[lcavy];
        ll L3=dis[u]+dis[y]-2*dis[lcauy]+1+dis[v]+dis[x]-2*dis[lcavx];
        if(((k%2)==(L1%2) && k>=L1) || ((k%2)==(L2%2) && k>=L2) || ((k%2)==(L3%2) && k>=L3))
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()
#define pi                  3.14159265359
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

const int N=1e5+10;
int n,l;
vector<int> adj[N];

int timer;
vector<int> tin(N), tout(N);
vector<vector<int>> up(N,vector<int>(l+1));

void dfs(int v, int p)
{
    tin[v] = ++timer;
    up[v][0] = p;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (int u : adj[v]) {
        if (u != p)
            dfs(u, v);
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[v] <= tout[u];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    timer = 0;
    l = ceil(log2(n));
//    up.assign(n, vector<int>(l + 1));
    dfs(root, root);
}

ll dis[N];
bool vis[N];
void bfs(int s)
{
    queue<int> q;
    q.push(s);
    vis[s]=true;
    while(!q.empty())
    {
        int now=q.front();
        q.pop();
        for(auto to : adj[now])
        {
            if(!vis[to])
            {
                vis[to]=true;
                q.push(to);
                dis[to]=dis[now]+1;
            }
        }
    }
}

int main()
{
 //   fastio;
    cin>>n;
    rep(i,0,n-1)
    {
        int a,b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    preprocess(1);
    bfs(1);

    int q;cin>>q;
    while(q--)
    {
        ll u,v,x,y,k;cin>>x>>y>>u>>v>>k;
        int anc=lca(u,v);
        ll L1=dis[u]+dis[v]-2*dis[anc];
        int ancux=lca(u,x),ancuy=lca(u,y);
        ll disuy=dis[u]+dis[y]-2*dis[ancuy];
        ll disux=dis[u]+dis[x]-2*dis[ancux];
        if(disuy<disux)swap(x,y),disux=disuy;
        int ancyv=lca(y,v);
        ll disyv=dis[y]+dis[v]-2*dis[ancyv];
        ll L2=disux+1+disyv;
        if(((k%2)==(L1%2) && k>=L1) || ((k%2)==(L2%2) && k>=L2))
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()
#define pi                  3.14159265359
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

const int N=1e5+10;
int n,l;
vector<int> adj[N];

int timer;
vector<int> tin(N), tout(N);
vector<vector<int>> up(N,vector<int>(l+1));

void dfs(int v, int p)
{
    tin[v] = ++timer;
    up[v][0] = p;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (int u : adj[v]) {
        if (u != p)
            dfs(u, v);
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[v] <= tout[u];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    timer = 0;
    l = ceil(log2(n));
//    up.assign(n, vector<int>(l + 1));
    dfs(root, root);
}

int dis[N];
bool vis[N];
void bfs(int s)
{
    queue<int> q;
    q.push(s);
    vis[s]=true;
    while(!q.empty())
    {
        int now=q.front();
        q.pop();
        for(auto to : adj[now])
        {
            if(!vis[to])
            {
                vis[to]=true;
                q.push(to);
                dis[to]=dis[now]+1;
            }
        }
    }
}

int main()
{
    fastio;
    cin>>n;
    rep(i,0,n-1)
    {
        int a,b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    preprocess(1);
    bfs(1);

    int q;cin>>q;
    while(q--)
    {
        int u,v,x,y,k;cin>>x>>y>>u>>v>>k;
        int anc=lca(u,v);
        int L1=dis[u]+dis[v]-2*dis[anc];
        int ancux=lca(u,x),ancyv=lca(y,v);
        int disux=dis[u]+dis[x]-2*dis[ancux];
        int disyv=dis[y]+dis[v]-2*dis[ancyv];
        int L2=disux+1+disyv;
        cout<<"********"<<L1<<" "<<L2<<endl;
        if(((k%2)==(L1%2)) || ((k%2)==(L2%2)))
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()
#define pi                  3.14159265359
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

const int N=1e5+10;
int n,l;
vector<int> adj[N];

int timer;
vector<int> tin(N), tout(N);
vector<vector<int>> up(N,vector<int>(l+1));

void dfs(int v, int p)
{
    tin[v] = ++timer;
    up[v][0] = p;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (int u : adj[v]) {
        if (u != p)
            dfs(u, v);
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[v] <= tout[u];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    timer = 0;
    l = ceil(log2(n));
//    up.assign(n, vector<int>(l + 1));
    dfs(root, root);
}

int dis[N];
bool vis[N];
void bfs(int s)
{
    queue<int> q;
    q.push(s);
    vis[s]=true;
    while(!q.empty())
    {
        int now=q.front();
        q.pop();
        for(auto to : adj[now])
        {
            if(!vis[to])
            {
                vis[to]=true;
                q.push(to);
                dis[to]=dis[now]+1;
            }
        }
    }
}

int main()
{
    fastio;
    cin>>n;
    rep(i,0,n-1)
    {
        int a,b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    preprocess(1);
    bfs(1);

    int q;cin>>q;
    while(q--)
    {
        int u,v,x,y,k;cin>>x>>y>>u>>v>>k;
        int anc=lca(u,v);
        int L1=dis[u]+dis[v]-2*dis[anc];
        int ancux=lca(u,x),ancyv=lca(y,v);
        int disux=dis[u]+dis[x]-2*dis[ancux];
        int disyv=dis[y]+dis[v]-2*dis[ancyv];
        int L2=disux+1+disyv;
        if(((k%2)==(L1%2)) || ((k%2)==(L2%2)))
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()
#define pi                  3.14159265359
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

const int N=1e5+10;
int n,l;
vector<int> adj[N];

int timer;
vector<int> tin(N), tout(N);
vector<vector<int>> up(N,vector<int>(l+1));

void dfs(int v, int p)
{
    tin[v] = ++timer;
    up[v][0] = p;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (int u : adj[v]) {
        if (u != p)
            dfs(u, v);
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[v] <= tout[u];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    timer = 0;
    l = ceil(log2(n));
//    up.assign(n, vector<int>(l + 1));
    dfs(root, root);
}

ll dis[N];
bool vis[N];
void bfs(int s)
{
    queue<int> q;
    q.push(s);
    vis[s]=true;
    while(!q.empty())
    {
        int now=q.front();
        q.pop();
        for(auto to : adj[now])
        {
            if(!vis[to])
            {
                vis[to]=true;
                q.push(to);
                dis[to]=dis[now]+1;
            }
        }
    }
}

int main()
{
 //   fastio;
    cin>>n;
    rep(i,0,n-1)
    {
        int a,b;cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }

    preprocess(1);
    bfs(1);

    int q;cin>>q;
    while(q--)
    {
        ll u,v,x,y,k;cin>>x>>y>>u>>v>>k;
        int anc=lca(u,v);
        ll L1=dis[u]+dis[v]-2*dis[anc];
        int lcaux=lca(u,x),lcauy=lca(u,y);
        int lcavx=lca(v,x),lcavy=lca(v,y);

        ll L2=dis[u]+dis[x]-2*dis[lcaux]+1+dis[y]+dis[v]-2*dis[lcavy];
        ll L3=dis[u]+dis[y]-2*dis[lcauy]+1+dis[v]+dis[x]-2*dis[lcavx];
        if(((k%2)==(L1%2) && k>=L1) || ((k%2)==(L2%2) && k>=L2) || ((k%2)==(L3%2) && k>=L3))
            cout<<"YES\n";
        else cout<<"NO\n";
    }
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug cout<<"here"<<endl;
#define ll long long int
#define mp make_pair
#define pb push_back
#define endl '\n'
const ll MOD=1e9+7;
#define MAX 200005
#define infi 1e12
#define intial 0
#define waiting 1
#define visited 2
#define PII pair<ll,ll>
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
using namespace std;
std::vector<int>adj[MAX];
int dp[MAX][20],dis[MAX]={0},tin[MAX],tout[MAX],tim=0;
void dfs(int u,int par){
	tin[u]=++tim;
	for(int v:adj[u]){
		if(v==par)
			continue;
		dp[v][0]=u;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
	tout[u]=++tim;
}

bool is_ancestor(int u,int v){
	if(tin[u]<=tin[v]&&tout[u]>=tout[v])
		return true;
	return false;
}

int LCA(int u,int v){
	if(is_ancestor(u,v))
		return u;
	if(is_ancestor(v,u))
		return v;
	for(int i=19;i>=0;i--){
		if(!is_ancestor(dp[u][i],v))
			u=dp[u][i];
	}
	return dp[u][0];
}
int cal_dis(int a,int b){
	int lca=LCA(a,b);
	return dis[a]+dis[b]-2*dis[lca];
}
bool solve(ll x,ll y,ll a,ll b,ll k){
	// without joining x and y, find dis b/w a and b
	int dist=cal_dis(a,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;

	// join x and y and do the same task as above
	dist=cal_dis(a,x)+1+cal_dis(y,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	dist=cal_dis(a,y)+1+cal_dis(x,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	return false;
}
int main()
{
	#ifndef LOCAL
	fast;
	#endif
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,1);
	for(int i=1;i<20;i++){
		for(int j=1;j<=n;j++)
			dp[j][i]=dp[dp[j][i-1]][i-1];
	}
	int q;
	cin>>q;
	while(q--){
		ll x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		if(solve(x,y,a,b,k))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug cout<<"here"<<endl;
#define ll long long int
#define mp make_pair
#define pb push_back
#define endl '\n'
const ll MOD=1e9+7;
#define MAX 200005
#define infi 1e12
#define intial 0
#define waiting 1
#define visited 2
#define PII pair<ll,ll>
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
using namespace std;
std::vector<int>adj[MAX];
int dp[MAX][20],dis[MAX]={0},tin[MAX],tout[MAX],tim=0;
void dfs(int u,int par){
	tin[u]=++tim;
	for(int v:adj[u]){
		if(v==par)
			continue;
		dp[v][0]=u;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
	tout[u]=++tim;
}

bool is_ancestor(int u,int v){
	if(tin[u]<tin[v]&&tout[u]>tout[v])
		return true;
	return false;
}

int LCA(int u,int v){
	if(is_ancestor(u,v))
		return u;
	if(is_ancestor(v,u))
		return v;
	for(int i=19;i>=0;i--){
		if(!is_ancestor(dp[u][i],v))
			u=dp[u][i];
	}
	return dp[u][0];
}
int cal_dis(int a,int b){
	int lca=LCA(a,b);
	return dis[a]+dis[b]-2*dis[lca];
}
bool solve(ll x,ll y,ll a,ll b,ll k){
	// without joining x and y, find dis b/w a and b
	int dist=cal_dis(a,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;

	// join x and y and do the same task as above

	dist=cal_dis(a,x)+1+cal_dis(y,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	dist=cal_dis(a,y)+1+cal_dis(x,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	return false;
}
int main()
{
	#ifndef LOCAL
	fast;
	#endif
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,-1);
	dp[1][0]=1;
	for(int i=1;i<20;i++){
		for(int j=1;j<=n;j++)
			dp[j][i]=dp[dp[j][i-1]][i-1];
	}
	int q;
	cin>>q;
	while(q--){
		ll x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		if(solve(x,y,a,b,k))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug cout<<"here"<<endl;
#define ll long long int
#define mp make_pair
#define pb push_back
#define endl '\n'
const ll MOD=1e9+7;
#define MAX 200005
#define infi 1e12
#define intial 0
#define waiting 1
#define visited 2
#define PII pair<ll,ll>
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
using namespace std;
std::vector<int>adj[MAX];
int dp[MAX][20],dis[MAX]={0},tin[MAX],tout[MAX],tim=0;
void dfs(int u,int par){
	tin[u]=++tim;
	for(int v:adj[u]){
		if(v==par)
			continue;
		dp[v][0]=u;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
	tout[u]=++tim;
}

bool is_ancestor(int u,int v){
	if(tin[u]<tin[v]&&tout[u]>tout[v])
		return true;
	return false;
}

int LCA(int u,int v){
	if(is_ancestor(u,v))
		return u;
	if(is_ancestor(v,u))
		return v;
	for(int i=19;i>=0;i--){
		if(!is_ancestor(dp[u][i],v))
			u=dp[u][i];
	}
	return dp[u][0];
}
int cal_dis(int a,int b){
	int lca=LCA(a,b);
	return dis[a]+dis[b]-2*dis[lca];
}
bool solve(ll x,ll y,ll a,ll b,ll k){
	// without joining x and y, find dis b/w a and b
	int dist=cal_dis(a,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;

	// join x and y and do the same task as above

	dist=cal_dis(a,x)+1+cal_dis(y,b);
	dist=min(dist,cal_dis(a,y)+1+cal_dis(x,b));
	if(k>=dist&&(k-dist)%2==0)
		return true;
	return false;
}
int main()
{
	#ifndef LOCAL
	fast;
	#endif
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,-1);
	dp[1][0]=1;
	for(int i=1;i<20;i++){
		for(int j=1;j<=n;j++)
			dp[j][i]=dp[dp[j][i-1]][i-1];
	}
	int q;
	cin>>q;
	while(q--){
		ll x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		if(solve(x,y,a,b,k))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug cout<<"here"<<endl;
#define ll long long int
#define mp make_pair
#define pb push_back
#define endl '\n'
const ll MOD=1e9+7;
#define MAX 200005
#define infi 1e12
#define intial 0
#define waiting 1
#define visited 2
#define PII pair<ll,ll>
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
using namespace std;
std::vector<int>adj[MAX];
int dp[MAX][20],dis[MAX]={0},tin[MAX],tout[MAX],tim=0;
void dfs(int u,int par){
	dp[u][0]=par;
	tin[u]=++tim;
	for(int v:adj[u]){
		if(v==par)
			continue;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
	tout[u]=++tim;
}

bool is_ancestor(int u,int v){
	if(tin[u]<=tin[v]&&tout[u]>=tout[v])
		return true;
	return false;
}

int LCA(int u,int v){
	if(is_ancestor(u,v))
		return u;
	if(is_ancestor(v,u))
		return v;
	for(int i=19;i>=0;i--){
		if(!is_ancestor(dp[u][i],v))
			u=dp[u][i];
	}
	return dp[u][0];
}
int cal_dis(int a,int b){
	int lca=LCA(a,b);
	return dis[a]+dis[b]-2*dis[lca];
}
bool solve(ll x,ll y,ll a,ll b,ll k){
	// without joining x and y, find dis b/w a and b
	int dist=cal_dis(a,b);
	// cout<<a<<" "<<b<<" "<<LCA(a,b)<<endl;
	if(k>=dist&&(k-dist)%2==0)
		return true;

	// join x and y and do the same task as above
	dist=cal_dis(a,x)+1+cal_dis(y,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	dist=cal_dis(a,y)+1+cal_dis(x,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	return false;
}
int main()
{
	#ifndef LOCAL
	fast;
	#endif
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,1);
	for(int i=1;i<20;i++){
		for(int j=1;j<=n;j++)
			dp[j][i]=dp[dp[j][i-1]][i-1];
	}
	int q;
	cin>>q;
	while(q--){
		ll x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		if(solve(x,y,a,b,k))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug cout<<"here"<<endl;
#define ll long long int
#define mp make_pair
#define pb push_back
#define endl '\n'
const ll MOD=1e9+7;
#define MAX 200005
#define infi 1e12
#define intial 0
#define waiting 1
#define visited 2
#define PII pair<ll,ll>
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
using namespace std;
std::vector<int>adj[MAX];
int dp[MAX][20],dis[MAX]={0},tin[MAX],tout[MAX],tim=0;
void dfs(int u,int par){
	tin[u]=++tim;
	for(int v:adj[u]){
		if(v==par)
			continue;
		dp[v][0]=u;
		dis[v]=dis[u]+1;
		dfs(v,u);
	}
	tout[u]=++tim;
}

bool is_ancestor(int u,int v){
	if(tin[u]<=tin[v]&&tout[u]>=tout[v])
		return true;
	return false;
}

int LCA(int u,int v){
	if(is_ancestor(u,v))
		return u;
	if(is_ancestor(v,u))
		return v;
	for(int i=19;i>=0;i--){
		if(!is_ancestor(dp[u][i],v))
			u=dp[u][i];
	}
	return dp[u][0];
}
int cal_dis(int a,int b){
	int lca=LCA(a,b);
	return dis[a]+dis[b]-2*dis[lca];
}
bool solve(ll x,ll y,ll a,ll b,ll k){
	// without joining x and y, find dis b/w a and b
	int dist=cal_dis(a,b);
	// cout<<a<<" "<<b<<" "<<LCA(a,b)<<endl;
	if(k>=dist&&(k-dist)%2==0)
		return true;

	// join x and y and do the same task as above
	dist=cal_dis(a,x)+1+cal_dis(y,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	dist=cal_dis(a,y)+1+cal_dis(x,b);
	if(k>=dist&&(k-dist)%2==0)
		return true;
	return false;
}
int main()
{
	#ifndef LOCAL
	fast;
	#endif
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1,1);
	dp[1][0]=1;
	for(int i=1;i<20;i++){
		for(int j=1;j<=n;j++)
			dp[j][i]=dp[dp[j][i-1]][i-1];
	}
	int q;
	cin>>q;
	while(q--){
		ll x,y,a,b,k;
		cin>>x>>y>>a>>b>>k;
		if(solve(x,y,a,b,k))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);++i)
#define REP1(i,a,b) for(int i=(a);i<=(b);++i)
#define em emplace_back
#define ALL(x) (x).begin(),(x).end()
#define mkp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define Rosario ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//#define lb(x) (x&-x)

int n,m,dep[100005],lca[100005][20];
vector<int> v[100005];
void dfs(int x,int d,int p){
    dep[x]=d;
    for(int i:v[x]){
        if(i!=p) lca[i][0]=x,dfs(i,d+1,x);
    }
}
inline void build(){
    for(int j=1;j<20;j++)
        for(int i=1;i<=n;i++) lca[i][j]=lca[lca[i][j-1]][j-1];
}
int fin(int a,int b){
    if(dep[a]>dep[b]) swap(a,b);
    for(int i=dep[b]-dep[a],k=0;i;i>>=1,k++){
        if(k&1) b=lca[b][k];
    }
    if(a==b) return a;
    for(int i=19;i>=0;i--){
        if(lca[a][i]!=lca[b][i]) a=lca[a][i],b=lca[b][i];
    }
    return lca[a][0];
}
int main(){Rosario
    cin>>n;
    for(int a,b,i=1;i<n;i++) cin>>a>>b,v[a].em(b),v[b].em(a);
    lca[1][0]=1;dfs(1,0,1);build();
    cin>>m;
    for(int A,B,C,x,y,a,b,k,i=0;i<m;i++){
        cin>>x>>y>>a>>b>>k;
        A=k-(dep[a]+dep[b]-2*fin(a,b));
        B=k-(dep[a]+dep[x]-2*fin(a,x))-1-(dep[b]+dep[y]-2*fin(b,y));
        C=k-(dep[a]+dep[y]-2*fin(a,y))-1-(dep[b]+dep[x]-2*fin(b,x));
        if(A>=0&&A%2==0) cout<<"YES";
        else if(B>=0&&B%2==0) cout<<"YES";
        else if(C>=0&&C%2==0) cout<<"YES";
        else cout<<"NO";
        cout<<"\n";
    }
//    system("pause");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);++i)
#define REP1(i,a,b) for(int i=(a);i<=(b);++i)
#define em emplace_back
#define ALL(x) (x).begin(),(x).end()
#define mkp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define Rosario ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//#define lb(x) (x&-x)

int n,m,tim=0,dep[100005],lca[100005][20],in[100005],out[100005];
vector<int> v[100005];
bitset<100005> vis;
void dfs(int x,int d){
    dep[x]=d;vis[x]=1;
    in[x]=++tim;
    for(int i:v[x]){
        if(!vis[i]) lca[i][0]=x,dfs(i,d+1);
    }
    out[x]=tim;
}
inline void build(){
    for(int j=1;j<20;j++)
        for(int i=1;i<=n;i++) lca[i][j]=lca[lca[i][j-1]][j-1];
}
inline bool is(int a,int b){return in[a]<=in[b]&&out[a]>=out[b];}
int fin(int a,int b){
    if(is(a,b)) return dep[b]-dep[a];
    if(is(b,a)) return dep[a]-dep[b];
    for(int i=19;i>=0;i--){
        if(!is(lca[a][i],b)) a=lca[a][i];
    }
    return dep[a]+dep[b]-dep[lca[a][0]]*2;
}
int main(){Rosario
    cin>>n;
    for(int a,b,i=1;i<n;i++) cin>>a>>b,v[a].em(b),v[b].em(a);
    lca[1][0]=1;dfs(1,0);build();
    cin>>m;
    for(int A,B,C,x,y,a,b,k,i=0;i<m;i++){
        cin>>x>>y>>a>>b>>k;
        A=k-fin(a,b);
        B=k-fin(a,x)-1-fin(b,y);
        C=k-fin(a,y)-1-fin(b,x);
        if(A>=0&&A%2==0) cout<<"YES";
        else if(B>=0&&B%2==0) cout<<"YES";
        else if(C>=0&&C%2==0) cout<<"YES";
        else cout<<"NO";
        cout<<"\n";
    }
//    system("pause");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);++i)
#define REP1(i,a,b) for(int i=(a);i<=(b);++i)
#define em emplace_back
#define ALL(x) (x).begin(),(x).end()
#define mkp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define Rosario ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//#define lb(x) (x&-x)

int n,m,dep[100005],in[100005],out[100005],lca[100005][20],t=0;
bitset<100005> vis;
vector<int> v[100005];
void dfs(int x,int d){
    dep[x]=d;in[x]=++t;vis[x]=1;
    for(int &i:v[x]) if(!vis[i]) lca[i][0]=x,dfs(i,d+1);
    out[x]=t;
}
inline void build(){
    for(int j=1;j<20;j++)
        for(int i=1;i<=n;i++) lca[i][j]=lca[lca[i][j-1]][j-1];
}
bool is(int a,int b){return in[a]<=in[b]&&out[a]>=out[b];}
int fin(int a,int b){
    if(dep[a]>dep[b]) swap(a,b);
    if(is(a,b)) return a;
    for(int i=19;i>=0;i--){
        if(!is(lca[b][i],a)) b=lca[b][i];
    }
    return lca[b][0];
}
inline int dis(int a,int b){return dep[a]+dep[b]-2*dep[fin(a,b)];}
int main(){Rosario
    cin>>n;
    int a,b,x,y,k,A,B,C;
    REP(i,n-1) cin>>a>>b,v[a].em(b),v[b].em(a);
    lca[1][0]=1;dfs(1,0);build();
    cin>>m;
    while(m--){
        cin>>x>>y>>a>>b>>k;
        A=k-dis(a,b);
        B=k-dis(a,x)-dis(b,y)-1;
        C=k-dis(a,y)-dis(b,x)-1;
        if(A>=0&&A%2==0) cout<<"YES\n";
        else if(B>=0&&B%2==0) cout<<"YES\n";
        else if(C>=0&&C%2==0) cout<<"YES\n";
        else cout<<"NO\n";
    }
//    system("pause");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);++i)
#define REP1(i,a,b) for(int i=(a);i<=(b);++i)
#define em emplace_back
#define ALL(x) (x).begin(),(x).end()
#define mkp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define Rosario ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//#define lb(x) (x&-x)

int n,m,tim=0,dep[500005],lca[500005][20],in[500005],out[500005];
vector<int> v[500005];
void dfs(int x,int d,int p){
    dep[x]=d;
    in[x]=++tim;
    for(int i:v[x]){
        if(i!=p) lca[i][0]=x,dfs(i,d+1,x);
    }
    out[x]=tim;
}
inline void build(){
    for(int j=1;j<20;j++)
        for(int i=1;i<=n;i++) lca[i][j]=lca[lca[i][j-1]][j-1];
}
inline bool is(int a,int b){return in[a]<=in[b]&&out[a]>=out[b];}
int fin(int a,int b){
    if(is(a,b)) return dep[b]-dep[a];
    if(is(b,a)) return dep[a]-dep[b];
    for(int i=19;i>=0;i--){
        if(!is(lca[a][i],b)) a=lca[a][i];
    }
    return dep[a]+dep[b]-dep[lca[a][0]]*2;
}
int main(){Rosario
    cin>>n;
    for(int a,b,i=1;i<n;i++) cin>>a>>b,v[a].em(b),v[b].em(a);
    lca[1][0]=1;dfs(1,0,1);build();
    cin>>m;
    for(int A,B,C,x,y,a,b,k,i=0;i<m;i++){
        cin>>x>>y>>a>>b>>k;
        A=k-fin(a,b);
        B=k-fin(a,x)-1-fin(b,y);
        C=k-fin(a,y)-1-fin(b,x);
        if(A>=0&&A%2==0) cout<<"YES";
        else if(B>=0&&B%2==0) cout<<"YES";
        else if(C>=0&&C%2==0) cout<<"YES";
        else cout<<"NO";
        cout<<"\n";
    }
//    system("pause");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define REP(i,n) for(int i=0;i<(n);++i)
#define REP1(i,a,b) for(int i=(a);i<=(b);++i)
#define em emplace_back
#define ALL(x) (x).begin(),(x).end()
#define mkp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define Rosario ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
//#define lb(x) (x&-x)

ll n,m,tim=0,dep[100005],lca[100005][20],in[100005],out[100005];
vector<ll> v[100005];
bitset<100005> vis;
void dfs(ll x,ll d){
    dep[x]=d;vis[x]=1;
    in[x]=++tim;
    for(ll i:v[x]){
        if(!vis[i]) lca[i][0]=x,dfs(i,d+1);
    }
    out[x]=tim;
}
inline void build(){
    for(int j=1;j<20;j++)
        for(int i=1;i<=n;i++) lca[i][j]=lca[lca[i][j-1]][j-1];
}
inline bool is(ll a,ll b){return in[a]<=in[b]&&out[a]>=out[b];}
ll fin(ll a,ll b){
    if(is(a,b)) return dep[b]-dep[a];
    if(is(b,a)) return dep[a]-dep[b];
    for(int i=19;i>=0;i--){
        if(!is(lca[a][i],b)) a=lca[a][i];
    }
    return dep[a]+dep[b]-dep[lca[a][0]]*2;
}
int main(){Rosario
    cin>>n;
    for(ll a,b,i=1;i<n;i++) cin>>a>>b,v[a].em(b),v[b].em(a);
    lca[1][0]=1;dfs(1,0);build();
    cin>>m;
    for(ll A,B,C,x,y,a,b,k,i=0;i<m;i++){
        cin>>x>>y>>a>>b>>k;
        A=k-fin(a,b);
        B=k-fin(a,x)-1-fin(b,y);
        C=k-fin(a,y)-1-fin(b,x);
        if(A>=0&&A%2==0) cout<<"YES";
        else if(B>=0&&B%2==0) cout<<"YES";
        else if(C>=0&&C%2==0) cout<<"YES";
        else cout<<"NO";
        cout<<"\n";
    }
//    system("pause");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 0) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, k;
		cin >> x >> y >> a >> b >> k;
		int dist = d(a, b);
		if((k - dist) % 2 == 0 && dist <= k){
			cout << "YES" << endl;
		}
		else{
			int xx = d(x, a) + d(y, b) + 1;
			int yy = d(y, a) + d(x, b) + 1;
			if((k - xx) % 2 == 0 && xx <= k){
				cout << "YES" << endl;
			}
			else cout << "NO" << endl;
		}

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 0) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, z;
		cin >> x >> y >> a >> b >> z;
		int dist = d(a, b);
		if(dist % 2 == z % 2 && dist <= z){
			cout << "YES" << endl;
		}
		else{
			int dx = d(x, a) + d(y, b) + 1;
			int dy = d(y, a) + d(x, b) + 1;
			int dtx = dx * 2;
			int dty = dy * 2;
			if(dx % 2 == z % 2 && dx <= z){
				cout << "YES" << endl;
			}
			else if(dy % 2 == z % 2 && dy <= z){
				cout << "YES" << endl;
			}
			else if(dtx % 2 == z % 2 && dtx <= z){
				cout << "YES" << endl;
			}
			else if(dty % 2 == z % 2 && dty <= z){
				cout << "YES" << endl;
			}
			else cout << "NO" << endl;
		}

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 0) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, z;
		cin >> x >> y >> a >> b >> z;
		int dist = d(a, b);
		if(dist % 2 == z % 2 && dist <= z){
			cout << "YES" << endl;
		}
		else{
			int dx = d(x, a) + d(y, b) + 1;
			int dy = d(y, a) + d(x, b) + 1;
			int dtx = dx * 2;
			int dty = dy * 2;
			int dtz = dx + d(a, b);
			int dtf = dy + d(a, b);
			if(dx % 2 == z % 2 && dx <= z){
				cout << "YES" << endl;
			}
			else if(dy % 2 == z % 2 && dy <= z){
				cout << "YES" << endl;
			}
			else if(dtx % 2 == z % 2 && dtx <= z){
				cout << "YES" << endl;
			}
			else if(dty % 2 == z % 2 && dty <= z){
				cout << "YES" << endl;
			}
			else if(dtz % 2 == z % 2 && dtz <= z){
				cout << "YES" << endl;
			}
			else if(dtf % 2 == z % 2 && dtf <= z){
				cout << "YES" << endl;
			}
			else cout << "NO" << endl;
		}

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 0) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, z;
		cin >> x >> y >> a >> b >> z;
		int dist = d(a, b);
		int dist2 = min(d(x, a) + d(y, b), d(x, b) + d(y, a)) + 1;
		if((z - dist) >= 0 && (z - dist) % 2 == 0){
			cout << "YES" << endl;
		}
		else if((z - dist2) >= 0 && (z - dist2) % 2 == 0){
			cout << "YES" << endl;
		}
		else cout << "NO" << endl;

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 1) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, z;
		cin >> x >> y >> a >> b >> z;
		int dist = d(a, b);
		int dist2 = min(d(x, a) + d(y, b), d(x, b) + d(y, a)) + 1;
		if((z - dist) >= 0 && (z - dist) % 2 == 0){
			cout << "YES" << endl;
		}
		else if((z - dist2) >= 0 && (z - dist2) % 2 == 0){
			cout << "YES" << endl;
		}
		else cout << "NO" << endl;

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)

#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}

void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
int l = 18, h[N];
vector<int> g[N];
int tin[N], tout[N];
int timer;
int up[N][20];

void dfs (int v, int p = 0) {
	h[v] = h[p] + 1;
	tin[v] = ++timer;
	up[v][0] = p;
	for (int i=1; i<=l; ++i)
		up[v][i] = up[up[v][i-1]][i-1];
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (to != p)
			dfs (to, v);
	}
	tout[v] = ++timer;
}

bool upper (int a, int b) {
	return tin[a] <= tin[b] && tout[a] >= tout[b];
}

int lca (int a, int b) {
	if (upper (a, b))  return a;
	if (upper (b, a))  return b;
	for (int i=l; i>=0; --i)
		if (! upper (up[a][i], b))
			a = up[a][i];
	return up[a][0];
}

int d(int x, int y){
	return h[x] + h[y] - 2 * h[lca(x, y)];
}
void solve()
{
	int n;
	cin >> n;
	for(int i = 0; i < n - 1; ++i){
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1);
	int q;
	cin >> q;
	for(int i = 0; i < q; ++i){
		int x, y, a, b, z;
		cin >> x >> y >> a >> b >> z;
		int dist = d(a, b);
		if(dist % 2 == z % 2 && dist <= z){
			cout << "YES" << endl;
		}
		else{
			int dx = d(x, a) + d(y, b) + 1;
			int dy = d(y, a) + d(x, b) + 1;
			int dtz = dx + d(a, b);
			int dtf = dy + d(a, b);
			if(dx % 2 == z % 2 && dx <= z){
				cout << "YES" << endl;
			}
			else if(dy % 2 == z % 2 && dy <= z){
				cout << "YES" << endl;
			}
			else if(dtz % 2 == z % 2 && dtz <= z){
				cout << "YES" << endl;
			}
			else if(dtf % 2 == z % 2 && dtf <= z){
				cout << "YES" << endl;
			}
			else cout << "NO" << endl;
		}

	}
}

int main()
{
    Red;
  	//int T; cin >> T; while(T--)
    solve();
    return 0;
}