s="gets.split.map{|e| e.to_f}" a,b=eval s n=gets.to_i x=eval s a=a*1000/3600 b=b*1000/3600 ok="YES" (n-1).times{|i| t=x[i]/a ok="NO" if x[i+1]