using System; using System.Linq; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Text; using System.Net; public class Program { public void Proc() { Reader.IsDebug = false; int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray(); int spdX = inpt[0]; int spdY = inpt[1]; int pointCount = int.Parse(Reader.ReadLine()); inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray(); String ans = "YES"; for(int i=0; i inpt[i+1]) { ans = "NO"; break; } } Console.WriteLine(ans); } public class Reader { public static bool IsDebug = true; private static System.IO.StringReader SReader; private static string InitText = @" 19 57 9 5 16 48 144 432 1296 3888 11664 34992 "; public static string ReadLine() { if(IsDebug) { if(SReader == null) { SReader = new System.IO.StringReader(InitText.Trim()); } return SReader.ReadLine(); } else { return Console.ReadLine(); } } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } }