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<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

bool visit(const vector<vi> &g, int v, vector<int> &order, vector<int> &color) {
  color[v] = 1;
  for(int e : g[v]) {
    if (color[e] == 2) continue;
    if (color[e] == 1) return false;
    if (!visit(g, e, order, color)) return false;
  }
  order.push_back(v); color[v] = 2;
  return true;
}
bool topologicalSort(const vector<vi> &g, vector<int> &order) {
  int n = g.size();
  vector<int> color(n);
  rep(u, n) if (!color[u] && !visit(g, u, order, color))
    return false;
  reverse(all(order));
  return true;
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int s, r; cin >> s >> r;
	int S, T, Q;
	vector<vi> g(s);
	
	{
		vi dist(s, inf), rdist(s, inf);
		vector<vector<pi>> e(s);
		rep(i, r){
			int a, b, c; cin >> a >> b >> c; a--; b--;
			e[a].emplace_back(b, c);
			e[b].emplace_back(a, c);
		}
		cin >> S >> T >> Q; S--; T--;
		
		auto dij = [](int s, const vector<vector<pi>> &e, vi &dist){
			int n = e.size();
			priority_queue<pi> q; q.emplace(0, s);
			while(!q.empty()){
				int c, d; tie(d, c) = q.top(); q.pop();
				if(dist[c] < -d) continue;
				dist[c] = -d;
				for(pi p : e[c]){
					int nd = -d + p.second;
					if(dist[p.first] > nd){
						dist[p.first] = nd;
						q.emplace(-nd, p.first);
					}
				}
			}
		};
		dij(S, e, dist);
		dij(T, e, rdist);
		/*
		dbg(dist);
		dbg(rdist);
		*/
		rep(i, s) for(pi p : e[i])
			if(dist[i] + p.second + rdist[p.first] == dist[T])
				g[i].pb(p.first);
	}
	//dbg(g);
	vi ord, rord(s);
	topologicalSort(g, ord);
	//dbg(ord);
	
	vector<pi> in;
	rep(it, Q){
		int a, b; cin >> a >> b; in.emplace_back(a - 1, b - 1);
		if(!(it == Q - 1 || in.size() == 64)) continue;
		vector<unsigned long long > f(s);
		rep(i, in.size()) f[in[i].first] |= 1ull << i;
		for(int i : ord) for(int j : g[i]) f[j] |= f[i];
		rep(i, in.size()) cout << (f[in[i].second] >> i & 1 ? "Yes" : "No") << endl;
		in.clear();
	}
	return 0;
}