local ffi = require 'ffi' local C = ffi.C ffi.cdef 'int getchar_unlocked(void);' print((function (f, g) return f(g(8)) and "YES" or "NO" end)(function (r) local x,y,n,a,b=r(),r(),r(),r(),0 for i=2,n do b=r() if a*y>b*x then return false end a=b end return true end, function (n) local a = ffi.new('uint8_t[?]',n) return function () for i=0,n do a[i]=C.getchar_unlocked() if a[i]==32 or a[i]==10 then a[i]=0 break end end return tonumber(ffi.string(a)) end end))