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) { double[] speed = Console.ReadLine().Trim().Split(' ').Select(x => double.Parse(x)).ToArray(); double spX = speed[0] * 1000 / 3600; double spY = speed[1] * 1000 / 3600; int coner = int.Parse(Console.ReadLine()); String look = "YES"; int[] road = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); double X = spX, Y = spY; int posX = 0, posY = 0; int roadX = 0, roadY = 0; for(int i = 0;i < coner;i++) { while(X >= roadX) { roadX += road[posX]; posX++; } while(Y >= roadY) { roadY += road[posY]; posY++; } if (posX + 1 < posY) { look = "NO"; break; } X += spX; Y += spY; } Console.WriteLine(look); } } }