#pragma GCC target("avx2") #pragma GCC optimize("Ofast,unroll-loops") #include #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) #define ALL(a) a.begin(), a.end() using namespace std; #if __has_include() #include using mint = atcoder::modint998244353; istream &operator>>(istream &is, mint &a) { int t; is >> t; a = t; return is; } ostream &operator<<(ostream &os, mint a) { return os << a.val(); } #endif typedef long double ldouble; #undef long #define long long long #define vec vector template ostream &operator<<(ostream &os, vector &a) { const int n = a.size(); rep(i, n) { os << a[i]; if (i + 1 != n) os << " "; } return os; } template ostream &operator<<(ostream &os, array &a) { rep(i, n) os << a[i] << " \n"[i + 1 == n]; return os; } template istream &operator>>(istream &is, vector &a) { for (T &i : a) is >> i; return is; } template bool chmin(T &x, S y) { if (x > (T)y) { x = (T)y; return true; } return false; } template bool chmax(T &x, S y) { if (x < (T)y) { x = (T)y; return true; } return false; } template void operator++(vector &a) { for (T &i : a) ++i; } template void operator--(vector &a) { for (T &i : a) --i; } template void operator++(vector &a, int) { for (T &i : a) i++; } template void operator--(vector &a, int) { for (T &i : a) i--; } #undef endl #define endl '\n' void solve() { int n, m; cin >> n >> m; if (n == 1) { cout << "No" << endl; return; } int s, t, k; cin >> s >> t >> k; s--, t--; vec> g(n); rep(i, m) { int a, b; cin >> a >> b; a--, b--; g[a].push_back(b); g[b].push_back(a); } if (s == t) { if (k % 2 == 1) { cout << "No" << endl; return; } if (g[s].size() >= 1) { cout << "Yes" << endl; return; } cout << "Unknown" << endl; return; } vec d(n); constexpr int inf = 1e9; vec dist(n, inf); queue q; q.push(s); d[s] = 1; dist[s] = 0; while (!q.empty()) { int v = q.front(); q.pop(); for (int u : g[v]) { if (d[u] == 0) { d[u] = -d[v]; dist[u] = dist[v] + 1; q.push(u); } } } if (k % 2 == 1) { if (d[t] == 1) { cout << "No" << endl; return; } if (dist[t] <= k) { cout << "Yes" << endl; return; } cout << "Unknown" << endl; return; } if (d[t] == -1) { cout << "No" << endl; return; } if (dist[t] <= k) { cout << "Yes" << endl; return; } cout << "Unknown" << endl; } int main() { // srand((unsigned)time(NULL)); cin.tie(nullptr); ios::sync_with_stdio(false); // cout << fixed << setprecision(40); int t = 1; // cin >> t; while (t--) solve(); return 0; }