#include using namespace std; using ll = long long; struct UnionFind { int ngroup, N; vector par, siz; UnionFind(int _N) : N(_N), par(_N), siz(_N){ ngroup = _N; for(int i = 0; i < N; i++) par[i] = i, siz[i] = 1; } int root(int x) { if (par[x] == x) return x; return par[x] = root(par[x]); } int unite(int x, int y) { int rx = root(x), ry = root(y); if (rx == ry) return rx; ngroup--; if (siz[rx] > siz[ry]) swap(rx, ry); par[rx] = ry; siz[ry] += siz[rx]; return ry; } bool same(int x, int y) { int rx = root(x), ry = root(y); return rx == ry; } int size(int x) {return siz[root(x)];} int group_count() {return ngroup;} vector> groups(){ vector rev(N); int nrt=0; for (int i=0; i> res(nrt); for (int i=0; i bfs(vector> &E, int start){ int N = E.size(); int from, to; queue que; vector dist(N, 1e9); dist[start] = 0; que.push(start); while(!que.empty()){ from = que.front(); que.pop(); for (auto to : E[from]){ if (dist[to] != 1e9) continue; dist[to] = dist[from] + 1; que.push(to); } } return dist; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int N, M, s, t, k, a, b; cin >> N >> M >> s >> t >> k; auto YES = [](){cout << "Yes" << endl; exit(0);}; auto NO = [](){cout << "No" << endl; exit(0);}; auto UNKNOWN = [](){cout << "Unknown" << endl; exit(0);}; vector> E(N+1); UnionFind uf(N+1); for (int i=1; i<=M; i++){ cin >> a >> b; E[a].push_back(b); E[b].push_back(a); uf.unite(a, b); } if (!uf.same(s, t)){ if (k % 2 == 1) UNKNOWN(); if (uf.size(s) >= 2 || uf.size(t) >= 2) UNKNOWN(); if (N > 2) UNKNOWN(); NO(); } if (s == t && M == 0){ if (N == 1) NO(); if (k % 2 == 1) NO(); UNKNOWN(); } vector color(N+1, -1); auto dfs=[&](auto self, int from)->void{ for (auto to : E[from]){ if (color[to] != -1) continue; color[to] = 1 - color[from]; self(self, to); } }; color[s] = 0; dfs(dfs, s); if (abs(color[s]-color[t]) % 2 != k % 2) NO(); vector dist = bfs(E, s); if (dist[t] <= k) YES(); else UNKNOWN(); return 0; }