//a290 BFS
/*
#include <iostream>
#include <vector>
#include <queue> // 先進先出
#include <algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
while(cin >> n){
int m;
cin >> m;
vector<int>v[801]; // 儲存圖-相鄰串鏈
queue<int>q;
int visit[801] = {};
while(m--){
int a, b;
cin >> a >> b;
if(a != b){ //避免收錯資料
v[a].push_back(b);
}
}// 收資料
int A, B;
bool found = false;
cin >> A >> B;
q.push(A);
visit[A] = 1;
while(!q.empty()){
int x = q.front();
q.pop();
if(x == B){
cout << "Yes!!!" << endl;
found = true; // 記錄已成功找到B
break;
}
for(auto i:v[x]){
if(visit[i] == 0){
q.push(i);
visit[i] = 1; // 記錄已訪問
}
}
}
if(found == false){
cout << "No!!!" << endl;
}
}
}
*/