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>
using namespace std;
typedef pair<int,int>P;
struct edge{
    int to,cost;
    edge(int to,int cost):to(to),cost(cost){}
};
const int INF=1001001001;
int N,M;
int S,T,Q;
vector<edge>G[100000];
vector<int>L[100000];
int dist[100000];
bool used[100000];
unsigned long long dp[100000];
vector<int>ord;
void dijkstra(){
    fill_n(dist,N,INF);
    dist[S]=0;
    priority_queue<P,vector<P>,greater<P> >que;
    que.push(P(0,S));

    while(que.size()){
        P p=que.top();que.pop();
        if(dist[p.second]<p.first)continue;
        for(int i=0;i<G[p.second].size();i++){
            edge &e=G[p.second][i];
            if(dist[e.to]<=p.first+e.cost)continue;
            dist[e.to]=p.first+e.cost;
            que.push(P(dist[e.to],e.to));
        }
    }
}

void dfs(int v){
    used[v]=true;
    for(int i=0;i<L[v].size();i++){
        int to=L[v][i];
        if(used[to])continue;
        dfs(to);
    }
    ord.push_back(v);
}

void build(){
    queue<int>que;
    que.push(T);
    used[T]=true;
    while(que.size()){
        int pos=que.front();que.pop();
        for(int i=0;i<G[pos].size();i++){
            edge &e=G[pos][i];
            if(dist[e.to]+e.cost==dist[pos]){
                L[e.to].push_back(pos);
                if(!used[e.to]){
                    used[e.to]=true;
                    que.push(e.to);
                }
            }
        }
    }
}

int main(){
    scanf("%d%d",&N,&M);
    for(int i=0;i<M;i++){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        a--;b--;
        G[a].push_back(edge(b,c));
        G[b].push_back(edge(a,c));
    }
    scanf("%d%d%d",&S,&T,&Q);
    S--;T--;

    dijkstra();

    build();
    fill_n(used,N,false);
    for(int i=0;i<N;i++)if(!used[i])dfs(i);
    reverse(ord.begin(),ord.end());


    for(int i=0;i<(Q+63)/64;i++){
        int a[64],b[64];
        int lim=min(64,Q-i*64);
        fill_n(dp,N,0);
        for(int j=0;j<lim;j++){
            scanf("%d%d",&a[j],&b[j]);
            a[j]--;b[j]--;
            dp[a[j]]|=(1ll<<j);
        }
        for(int j=0;j<N;j++){
            int v=ord[j];
            for(int k=0;k<L[v].size();k++){
                int to=L[v][k];
                dp[to]|=dp[v];
            }
        }

        for(int j=0;j<lim;j++){
            if(dp[b[j]]>>j&1)puts("Yes");
            else puts("No");
        }
    }
    return 0;
}