using System; using System.Collections.Generic; using System.Linq; using System.IO; class Program { static void Main() { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; var s = Console.ReadLine(); if (s != s.Trim()) { Console.WriteLine("unexpected spase"); return; } var a = s.Split().Select(int.Parse).ToArray(); var t = Console.ReadLine(); if (t != t.Trim()) { Console.WriteLine("unexpected spase"); return; } var b = t.Split().Select(int.Parse).ToArray(); if (b[0] == b[1]) { Console.WriteLine("unexpected input"); return; } sw.WriteLine(cls(a[1], b[0]) == cls(a[1], b[1]) ? "YES" : "NO"); sw.Flush(); } static int cls(int m, int x) { int a = (x - 1) % (m * 2); return a < m ? a + 1 : m * 2 - a; } }