#include using namespace std; class UnionFind{ public: vector par,siz; void make(int N){ par.resize(N,-1); siz.resize(N,1); } int root(int x){ if(par.at(x) == -1) return x; else return par.at(x) = root(par.at(x)); } void unite(int u, int v){ u = root(u),v = root(v); if(u == v) return; if(siz.at(u) < siz.at(v)) swap(u,v); par.at(v) = u; siz.at(u) += siz.at(v); } bool issame(int u, int v){ if(root(u) == root(v)) return true; else return false; } }; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; int s,t,k; cin >> s >> t >> k; s--; t--; UnionFind Z; Z.make(N); vector> Graph(N); for(int i=0; i> u >> v; u--; v--; Z.unite(u,v); Graph.at(u).push_back(v); Graph.at(v).push_back(u); } if(Z.issame(s,t) == false){ if(N == 2 && k%2 == 0) cout << "No" << endl; else cout << "Unknown" << endl; return 0; } if(s == t){ if(k%2) cout << "No" << endl; else if(Graph.at(s).size() == 0) cout << "Unknown" << endl; else cout << "Yes" << endl; return 0; } vector color(N,-1),dist(N,-1); color.at(s) = 0; dist.at(s) = 0; queue Q; Q.push(s); while(Q.size()){ int pos = Q.front(); Q.pop(); int d = dist.at(pos),c = color.at(pos); for(auto to : Graph.at(pos)){ if(dist.at(to) != -1) continue; dist.at(to) = d+1; color.at(to) = c^1; Q.push(to); } } int diffc = 0; if(color.at(s) != color.at(t)) diffc = 1; if(k%2 != diffc) cout << "No" << endl; else if(dist.at(t) <= k) cout << "Yes" << endl; else cout << "Unknown" << endl; }