#include #include using namespace std; int N,M,s,t,K,dist[2<<17]; vectorG[2<<17]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>M>>s>>t>>K; s--,t--; atcoder::dsu uf(N); for(;M--;) { int u,v; cin>>u>>v; u--,v--; G[u].push_back(v); G[v].push_back(u); uf.merge(u,v); } for(int i=0;iq; q.push(s); while(!q.empty()) { int u=q.front(); q.pop(); for(int v:G[u])if(dist[v]>dist[u]+1) { dist[v]=dist[u]+1; q.push(v); } } if(dist[t]<=K&&(K-dist[t])%2==0) { cout<<"Yes\n"; return 0; } if(uf.same(s,t)) { assert(dist[t]<(1<<30)); if((dist[t]-K)%2!=0) { cout<<"No\n"; return 0; } } if(N==1) { cout<<"No\n"; return 0; } if(N==2) { assert(!uf.same(0,1)); if(K&1) { cout<<(s!=t?"Unknown\n":"No\n"); } else { cout<<(s==t?"Unknown\n":"No\n"); } return 0; } cout<<"Unknown\n"; }