using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace pj12 { class Program { static void Main(string[] args) { int[] speed = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); speed[0] = speed[0] * 1000 / 60 / 60; speed[1] = speed[1] * 1000 / 60 / 60; int coner = int.Parse(Console.ReadLine()); String look = "YES"; int[] road = new int[coner]; int[] line = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); for(int i = 0;i < coner;i++) { road[i] = line[i]; } int nowX = 0, nowY = 0; for(int i = 0;i < coner;i++) { for (int j = 0; j < coner;j++ ) { if(speed[0] <= 0) { nowX = j; } else { speed[0] -= road[j]; } if (speed[1] <= 0) { nowY = j; } else { speed[1] -= road[j]; } if(nowX - nowY > 1) { look = "NO"; break; } } speed[0] += speed[0]; speed[1] += speed[1]; } Console.WriteLine(look); } } }