#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 100001

enum Type{
	from_A,
	from_B,
};

struct Edge{
	Edge(int arg_to,int arg_dist){
		to = arg_to;
		dist = arg_dist;
	}
	int to,dist;
};

struct Info{
	Info(int arg_node_id,int arg_sum_dist){
		node_id = arg_node_id;
		sum_dist = arg_sum_dist;
	}
	bool operator<(const struct Info &arg) const{ //総距離の昇順(PQ)
		return sum_dist > arg.sum_dist;
	}

	int node_id,sum_dist;
};

struct Data{
	Data(int arg_node_id,int arg_sum_dist){
		node_id = arg_node_id;
		sum_dist = arg_sum_dist;
	}
	bool operator<(const struct Data &arg) const{
		return sum_dist < arg.sum_dist;
	}
	int node_id,sum_dist;
};

int N,M;
int A,B,C,D;
int min_dist[NUM][2];
bool is_on_shortest_path[NUM],visited[NUM];
vector<Edge> G[NUM];
vector<int> DAG_G[NUM];

void dijkstra(int start,Type type){

	for(int i = 0; i < N; i++)min_dist[i][type] = BIG_NUM;
	min_dist[start][type] = 0;

	priority_queue<Info> Q;
	Q.push(Info(start,0));

	int next_node,next_dist;
	while(!Q.empty()){
		if(Q.top().sum_dist > min_dist[Q.top().node_id][type]){
			Q.pop();
		}else{

			for(int i = 0; i < G[Q.top().node_id].size(); i++){
				next_node = G[Q.top().node_id][i].to;
				next_dist = Q.top().sum_dist+G[Q.top().node_id][i].dist;

				if(min_dist[next_node][type] > next_dist){
					min_dist[next_node][type] = next_dist;
					Q.push(Info(next_node,next_dist));
				}
			}
			Q.pop();
		}
	}
}

bool can_visit(int node_id,int goal){

	int next_node;

	for(int i = 0; i < DAG_G[node_id].size(); i++){
		next_node = DAG_G[node_id][i];
		if(next_node == goal)return true;

		if(min_dist[next_node][from_A] >= min_dist[D][from_A])continue; //Dより遠いノードはSKIP
		if(visited[next_node])continue;

		visited[next_node] = true; //枝分かれ後に合流する可能性あり
		if(can_visit(next_node,goal))return true;
	}
	return false;
}


int main(){

	scanf("%d %d",&N,&M);

	int from,to,dist;
	for(int loop = 0; loop < M; loop++){
		scanf("%d %d %d",&from,&to,&dist);
		from--;
		to--;
		G[from].push_back(Edge(to,dist));
		G[to].push_back(Edge(from,dist));
	}

	int num_query;
	scanf("%d %d %d",&A,&B,&num_query);
	A--;
	B--;

	//AとBからダイクストラ
	dijkstra(A,from_A);
	dijkstra(B,from_B);

	//A→B間の最短距離上に無い点を調べる
	for(int i = 0; i < N; i++){
		if(min_dist[i][from_A]+min_dist[i][from_B] == min_dist[B][from_A]){
			is_on_shortest_path[i] = true;
		}else{
			is_on_shortest_path[i] = false;
		}
	}

	vector<Data> V;
	//最短経路DAGを構成する
	for(int i = 0; i < N; i++){
		if(is_on_shortest_path[i]){
			V.push_back(Data(i,min_dist[i][from_A]));
		}
	}

	sort(V.begin(),V.end());

	int node_id,next_node;
	//最短経路DAG上のエッジを生成する
	for(int i = 0; i < V.size(); i++){
		node_id = V[i].node_id;

		for(int k = 0; k < G[node_id].size(); k++){
			next_node = G[node_id][k].to;
			if(min_dist[next_node][from_A] <= min_dist[node_id][from_A])continue; //next_nodeの方がAに近ければSKIP

			if(min_dist[node_id][from_A]+G[node_id][k].dist+min_dist[next_node][from_B] > min_dist[B][from_A])continue; //最短経路上の辺でなければSKIP

			DAG_G[node_id].push_back(next_node);
		}
	}

	for(int loop = 0; loop < num_query; loop++){
		scanf("%d %d",&C,&D);
		C--;
		D--;
		if(is_on_shortest_path[C] == false || is_on_shortest_path[D] == false ||
				min_dist[C][from_A] >= min_dist[D][from_A]){
				printf("No\n");
				continue;
		}

		for(int i = 0; i < N; i++)visited[i] = false;

		visited[C] = true;
		if(can_visit(C,D)){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}

	return 0;
}

