Problem: We have decided to introduce an automatic ticket gate to the railway network of a certain country. One of the difficult issues to implement is determining whether a given ticket can move between designated stations. Each ticket has a boarding station and a getting-off station. With this ticket, you can not only "get on at the boarding station and get off at the getting off station", but you are also allowed to get on and off the train.

There are S stations on this rail network, of which Group R stations are adjacent and can be traversed in both directions without going through other stations. There is only one railroad track connecting adjacent stations. The distance between adjacent stations is the distance measured along this railroad track. There are multiple possible routes from one station to another, depending on the shape of the railway network, but the route with the shortest distance is called the shortest route. If there are multiple such routes, both are accepted as the shortest route.

You can move from station c to station d with a ticket for boarding station a and getting off station b if there is a route p that meets all of the following conditions.

* Route p is the shortest route from station a to station b.
* Route p is a route that starts from station a, goes through station c, then station d, and ends at station b. The section from station c to station d is the shortest route between these two stations.



You will be given route map and ticket information. Next, you will be given several pairs of start and end points, so write a program that determines whether you can move from the start point to the end point with that ticket.



input

The input consists of one dataset. Input data is given in the following format.


S R
u1 v1 w1
u2 v2 w2
::
uR vR wR
a b Q
c1 d1
::
cQ dQ


The numbers given on each line are separated by a single space.

The first line consists of two integers. S (2 ≤ S ≤ 100000) is the number of stations that appear on the railroad map, and R (1 ≤ R ≤ 200000) is the number of pairs of adjacent stations. The following R line is given information on the railroad tracks that directly connect adjacent stations. ui and vi (1 ≤ ui, vi ≤ S) indicate the station numbers at both ends of the i-th line. wi (1 ≤ wi ≤ 1000) is an integer representing the distance between these stations. However, numbers from 1 to S are assigned to each station without duplication, and ui ≠ vi.

The next line consists of three integers. The first two integers represent the ticket sections, where a is the boarding station and b is the getting-off station (1 ≤ a, b ≤ S). The third integer Q (1 ≤ Q ≤ 40000) indicates the number of questions. The question is given on the following Q line. ci and di (1 ≤ ci, di ≤ S) indicate the boarding and alighting stations of the i-th question. However, a ≠ b and ci ≠ di.

output

For each question, print Yes if you can move with the given ticket, or No if you can't.

Example

Input

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


Output

Yes
Yes
Yes
Yes
No
No

Solution (in CPP):

Solution:
#include <queue>
#include <cstdio>
#include <cstring>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef long long ll;

const int INF=1<<29;

struct edge{ int v,cost; };

void Dijkstra(int n,const vector<edge> *G,int s,int *dist){
	rep(u,n) dist[u]=(u==s?0:INF);
	priority_queue< pair<int,int> > Q; Q.push(make_pair(0,s));
	while(!Q.empty()){
		int d_now=-Q.top().first,u=Q.top().second; Q.pop();
		if(d_now>dist[u]) continue;
		rep(i,G[u].size()){
			int v=G[u][i].v,cost=G[u][i].cost;
			if(dist[v]>dist[u]+cost){
				dist[v]=dist[u]+cost;
				Q.push(make_pair(-dist[v],v));
			}
		}
	}
}

int main(){
	int n,m; scanf("%d%d",&n,&m);
	static vector<edge> G[100000];
	rep(i,m){
		int u,v,cost; scanf("%d%d%d",&u,&v,&cost); u--; v--;
		G[u].push_back((edge){v,cost});
		G[v].push_back((edge){u,cost});
	}

	int a,b,q; scanf("%d%d%d",&a,&b,&q); a--; b--;
	static int c[40000],d[40000];
	rep(i,q) scanf("%d%d",c+i,d+i), c[i]--, d[i]--;

	// calculate distances from a/b
	static int dist_a[100000]; Dijkstra(n,G,a,dist_a);
	static int dist_b[100000]; Dijkstra(n,G,b,dist_b);

	// build the shortest path DAG from a to b
	static vector<int> H[100000];
	rep(u,n) rep(i,G[u].size()) {
		int v=G[u][i].v,cost=G[u][i].cost;
		if(dist_a[u]+cost+dist_b[v]==dist_a[b]) H[u].push_back(v);
	}

	// find a topological order of H
	vector<int> top;
	static int deg[100000]; // degree of vertices
	rep(u,n) rep(i,H[u].size()) {
		int v=H[u][i];
		deg[v]++;
	}
	queue<int> Q; Q.push(a);
	while(!Q.empty()){
		int u=Q.front(); Q.pop();
		top.push_back(u);
		rep(i,H[u].size()){
			int v=H[u][i];
			deg[v]--;
			if(deg[v]==0) Q.push(v);
		}
	}

	// query
	rep(i,(q+63)/64){
		static ll dp[100000];
		memset(dp,0,sizeof dp);
		rep(j,64) if(64*i+j<q) dp[c[64*i+j]]|=1LL<<j;
		rep(i,top.size()){
			int u=top[i];
			rep(j,H[u].size()){
				int v=H[u][j];
				dp[v]|=dp[u];
			}
		}
		rep(j,64) if(64*i+j<q) puts(dp[d[64*i+j]]&(1LL<<j)?"Yes":"No");
	}

	return 0;
}