namespace AtCoder; #nullable enable using System.Numerics; static class Extensions { public static T[] Repeat(this int time, Func F) => Enumerable.Range(0, time).Select(_ => F()).ToArray(); } class Graph { public struct Edge { public int Ab { get; set; } public int Ad { get; set; } public T Distance { get; set; } } public int N { get; private init; } public bool Directed { get; private init; } public List> AdjacencyList { get; private init; } public List Edges { get; private init; } public Graph(int verticals, IReadOnlyList edges, bool directed) { N = verticals; Directed = directed; AdjacencyList = new List>(); for (var i = 0; i < N; i++) AdjacencyList.Add(new List<(int, int)>()); Edges = new List(); for (var i = 0; i < edges.Count; i++) { var edge = edges[i]; Edges.Add(edge); AdjacencyList[edge.Ab].Add((edge.Ad, i)); if (!Directed) AdjacencyList[edge.Ad].Add((edge.Ab, i)); } } } class GraphBuilder { public static Graph SimpleGraph(int verticals, (int ab, int ad)[] edges, bool directed) { var e = edges.Select(e => new Graph.Edge { Ab = e.ab, Ad = e.ad, Distance = 1 }).ToList(); return new(verticals, e, directed); } public static Graph Graph(int verticals, (int ab, int ad, T edge)[] edges, bool directed) { var e = edges.Select(e => new Graph.Edge { Ab = e.ab, Ad = e.ad, Distance = e.edge }).ToList(); return new(verticals, e, directed); } } class AtCoder { object? Solve() { var n = Int(); var m = Int(); var s = Int() - 1; var t = Int() - 1; var k = Int(); var edges = m.Repeat(() => (Int() - 1, Int() - 1)); var g = GraphBuilder.SimpleGraph(n, edges, false).AdjacencyList; var max = int.MaxValue / 2; var cz = new int[n]; var dz = n.Repeat(() => max); cz[s] = 1; dz[s] = 0; var q = new Queue(); q.Enqueue(s); while (q.Count > 0) { var v = q.Dequeue(); var w = dz[v] + 1; var nc = -cz[v]; foreach (var (next, _) in g[v]) { if (dz[next] <= w) continue; cz[next] = nc; dz[next] = w; q.Enqueue(next); } } if (k % 2 == 0 && cz[t] == -1 || k % 2 == 1 && cz[t] == 1) return false; if (dz[t] <= k) return true; return "Unknown"; } public static void Main() => new AtCoder().Run(); public void Run() { var res = Solve(); if (res != null) { if (res is bool yes) res = yes ? "Yes" : "No"; sw.WriteLine(res); } sw.Flush(); } string[] input = Array.Empty(); int iter = 0; readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false }; #pragma warning disable IDE0051 string String() { while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Split(' '), 0); return input[iter++]; } T Input() where T : IParsable => T.Parse(String(), null); int Int() => Input(); void Out(object? x, string? separator = null) { separator ??= Environment.NewLine; if (x is System.Collections.IEnumerable obj and not string) { var firstLine = true; foreach (var item in obj) { if (!firstLine) sw.Write(separator); firstLine = false; sw.Write(item); } } else sw.Write(x); sw.WriteLine(); } #pragma warning restore IDE0051 }