#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(2*N),uf2(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+N); uf.merge(u+N,v); uf2.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(uf2.same(s,t)) { assert(dist[t]<(1<<30)); if((dist[t]-K)%2!=0) { cout<<"No\n"; return 0; } } // cout<<"Unknown\n"; }