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 <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)x.size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

struct edge{int to,cost;
edge(int to,int cost):to(to),cost(cost){}};

int S,R;
vector<edge> g1[100010],g2[100010];
vi g3[100010];
vector<pi> G;
int a,b,nq;
int dist[100010],used[100010];
pi distv[100010];
ll mask[100010];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>S>>R;
	rep(i,R){
		int u,v,w;
		cin>>u>>v>>w;
		u--,v--;
		g1[u].pb(edge(v,w));
		g1[v].pb(edge(u,w));
	}
	cin>>a>>b>>nq;
	a--;b--;
	
	fill(dist,dist+S,INF);
	priority_queue<pi,vector<pi>,greater<pi> > Q;
	dist[a]=0;
	Q.push(mp(0,a));
	
	while(sz(Q)){
		pi p=Q.top();Q.pop();
		int v=p.sec;
		if(p.fir > dist[v])continue;
		rep(i,sz(g1[v])){
			int w=g1[v][i].to;
			int nd=p.fir+g1[v][i].cost;
			if(nd < dist[w]){
				dist[w]=nd;
				Q.push(mp(nd,w));
			}
		}
	}
	
	rep(i,S)rep(j,sz(g1[i])){
		if(dist[i]+g1[i][j].cost == dist[g1[i][j].to]){
			g2[g1[i][j].to].pb(edge(i,g1[i][j].cost));
		}
	}
	
	stack<int> T;
	T.push(b);
	
	while(sz(T)){
		int v=T.top();T.pop();
		if(used[v])continue;
		used[v]=1;
		rep(i,sz(g2[v])){
			int w=g2[v][i].to;
			if(dist[v] == dist[w]+g2[v][i].cost){
				g3[w].pb(v);
				T.push(w);
			}
		}
	}
	
	rep(i,S)distv[i]=mp(dist[i],i);
	sort(distv,distv+S);
	
	rep(i,S){
		int v=distv[i].sec;
		rep(j,sz(g3[v])){
			G.pb(mp(v,g3[v][j]));
		}
	}
	
	int c,d;
	vector<pi> q;
	rep(i,nq){
		cin>>c>>d;
		q.pb(mp(c-1,d-1));
		if(sz(q)==64 || i==nq-1){
			fill(mask,mask+S,0);
			rep(j,sz(q)){
				mask[q[j].fir] |= 1LL<<j;
			}
			rep(j,sz(G)){
				mask[G[j].sec] |= mask[G[j].fir];
			}
			rep(j,sz(q)){
				cout<<(mask[q[j].sec] & 1LL<<j ? "Yes":"No")<<endl;
			}
			q.clear();
		}
	}
}