using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("3 3 12"); WillReturn.Add("0 10 30"); } else if (InputPattern == "Input2") { WillReturn.Add("4 1 100"); WillReturn.Add("0 100 200 0"); } else if (InputPattern == "Input3") { WillReturn.Add("10 5 1"); WillReturn.Add("1 0 0 0 0 0 0 0 0 7"); } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); long[] wkArr = InputList[0].Split(' ').Select(pX => long.Parse(pX)).ToArray(); long S = wkArr[1]; long B = wkArr[2]; long[] HArr = InputList[1].Split(' ').Select(pX => long.Parse(pX)).ToArray(); long MaxHeight = HArr[0] + S * B; foreach (long EachH in HArr) { if (EachH > MaxHeight) { Console.WriteLine("No"); return; } long NewHeight = EachH + S * B; MaxHeight = Math.Max(MaxHeight, NewHeight); } Console.WriteLine("Yes"); } }